我想用L20n本地化一个Web应用程序,在UI中,一个单词后跟冒号后面。例如:<!--
DataSource with connection polling
For more details, see: http://www.mchange.com/projects/c3p0/
-->
<bean id="dataSource" class="com.mchange.v2.c3p0.ComboPooledDataSource" destroy-method="close">
<property name="driverClass" value="oracle.jdbc.driver.OracleDriver" />
<property name="jdbcUrl" value="jdbc:oracle:thin:@//hostaname:1527/servicename" />
<property name="user" value="user" />
<property name="password" value="password" />
<!-- Other DataSource Configuration -->
<property name="numHelperThreads" value="10" />
<property name="maxAdministrativeTaskTime" value="10000" />
<!-- pool sizing -->
<property name="initialPoolSize" value="3" />
<property name="minPoolSize" value="10" />
<property name="maxPoolSize" value="35" />
<property name="acquireIncrement" value="3" />
<property name="maxStatements" value="0" />
<!-- retries -->
<property name="acquireRetryAttempts" value="30" />
<property name="acquireRetryDelay" value="1000" /> <!-- 1s -->
<property name="breakAfterAcquireFailure" value="false" />
<!-- refreshing connections -->
<property name="maxIdleTime" value="180" /> <!-- 3min -->
<property name="maxConnectionAge" value="300" />
<!-- timeouts and testing -->
<property name="checkoutTimeout" value="5000" /> <!-- 5s -->
<property name="idleConnectionTestPeriod" value="60" /> <!-- 60s -->
<property name="testConnectionOnCheckout" value="true" />
<property name="testConnectionOnCheckin" value="true" />
<property name="preferredTestQuery" value="alter session set current_schema=MY_SCHEMA" />
<!-- extensions -->
<property name="extensions">
<map>
<entry key="timezone" value="UTC" />
</map>
</property>
</bean>
。
以下方法有效,但缺点是必须为每个单词定义一个额外的标记,后跟冒号。
Foo:
我尝试了以下方法来避免这些额外的标签,但这种方法不起作用。
In the .l20n-File:
<foo "Foo">
<fooCol "{{foo}}:">
In the .html-File:
<p data-l10n-id="fooCol"></p>
L20n中是否有一种优雅的方法可以为单词添加后缀?
答案 0 :(得分:2)
我错过了明显的解决方案:
<p><span data-l10n-id="foo"></span>:</p>