L20n/Features/Multilocale resources: Difference between revisions

From MozillaWiki
< L20n‎ | Features
Jump to navigation Jump to search
(Created page with "== goals == * create index resource files that load proper resource files per locale * store source entities that were used to localize the entities in order to enable tools to r...")
 
No edit summary
Line 4: Line 4:


== example ==
== example ==
 
<pre>
en-US: {
en-US: {
  @import("path/to/fr/resource")
  @import("path/to/fr/resource")
Line 12: Line 12:
  @import("path/to/en/resource")
  @import("path/to/en/resource")
}
}
</pre>


en-US: {
In this case, we keep a list of imports that depend on the locale being used.
  <phone "Phone">
  <address "Address">
}
 
============> for 3way merge


===== for 3way merge =====
<pre>
<phone "Telefon">
<phone "Telefon">
<address "Adres">
<address "Adres">
Line 27: Line 25:
  <address "Address">
  <address "Address">
}
}
</pre>


en-US.lol:
In this case we store entities that have been used as a base for translation. This allows us to compare the source entity from en-US locale with the source entity from translated locale and identify entities that were translated against old version of the string.


<phone "Phone.">
== status ==
<address "Address">


== status ==
So far we decided that we don't want to introduce another block structure into L20n, and we can reuse [[L20n/Features/Conditional_blocks|if in @import]] for the former goal.
 
<pre>
@import("path/to/resource") if (@localeCode=="en-US")
@import("path/to/resource2") if (@localeCode=="pl")
</pre>
 
For the latter purpose we're leaning toward storing some sort of .orig file that contains source entities for the 3way-merge.
 
* gandalf - accepted
* stas - accepted
* pike - ?

Revision as of 16:28, 28 February 2012

goals

  • create index resource files that load proper resource files per locale
  • store source entities that were used to localize the entities in order to enable tools to recognize outdated localization.

example

en-US: {
  @import("path/to/fr/resource")
}

en-GB: {
  @import("path/to/en/resource")
}

In this case, we keep a list of imports that depend on the locale being used.

for 3way merge
<phone "Telefon">
<address "Adres">

en-US: {
  <phone "Phone">
  <address "Address">
}

In this case we store entities that have been used as a base for translation. This allows us to compare the source entity from en-US locale with the source entity from translated locale and identify entities that were translated against old version of the string.

status

So far we decided that we don't want to introduce another block structure into L20n, and we can reuse if in @import for the former goal.

@import("path/to/resource") if (@localeCode=="en-US")
@import("path/to/resource2") if (@localeCode=="pl")

For the latter purpose we're leaning toward storing some sort of .orig file that contains source entities for the 3way-merge.

  • gandalf - accepted
  • stas - accepted
  • pike - ?