L20n/Features/Entities vs Variables: Difference between revisions

no edit summary
No edit summary
No edit summary
Line 6: Line 6:
We decided to separate the expression syntax used to call to other entities from the syntax used to reference developer provided variables.
We decided to separate the expression syntax used to call to other entities from the syntax used to reference developer provided variables.


Developer provided variables (either from the context or a call) are referenced by a name, no changes here. But in order to reference another entity, a prefix ":" has to be used. It looks like this:
Entities are referenced by a name, no changes here. But in order to reference a developer provided variable (either from the context or a call) a prefix "$" has to be used. It looks like this:


<pre>
<pre>
Line 17: Line 17:
>
>


<about "About {{ :brandName.nominative }}">
<about "About {{ brandName.nominative }}">
<update[:brandName:_gender.win] {
<update[brandName.._gender.win] {
   male: "{{ :brandName }} has been updated.  The update took {{ updateTime }} seconds."
   male: "{{ brandName }} has been updated.  The update took {{ $updateTime }} seconds."
   female: "{{ :brandName:accesskey.mac }}"
   female: "{{ brandName..accesskey.mac }}"
}>
}>
</pre>
</pre>


The rationale here is that we expect localizers to reference developer provided variables much more often, while referencing other entities (except for a brandName like cases) will be rather an exception.


For computed calls, the syntax will look like this:
<pre>
/*
  For variables:
  var1 - "accesskey"
  var2 - "entity2"
  var3 - "win"
*/
<entity1 "value"
accesskey: "c">
<entity2 "value">
<entity3 {
  win: "test",
  lin: "test2"
}>
/*
  This will compute to "Hello c and value and test"
*/
<title "Hello {{ :entity1:[var1] }} and {{ :[var2] }} and {{ :entity3[var3] }}">
</pre>


== status ==
== status ==
canmove, Confirmed users
1,448

edits