Account confirmers, canmove, Confirmed users
2,357
edits
(Created page with "== goal == allow for entities to be enabled only for some screen sizes, operating systems, languages etc. == examples == Basically there are two concepts here. One is to group...") |
No edit summary |
||
| (8 intermediate revisions by 2 users not shown) | |||
| Line 1: | Line 1: | ||
[[Category:L20n Features|{{SUBPAGENAME}}]] | |||
[[Category:L20n]] __NOTOC__ | |||
== goal == | == goal == | ||
| Line 11: | Line 14: | ||
For the block cases, the syntax might look similar to this: | For the block cases, the syntax might look similar to this: | ||
<pre> | <pre> | ||
if (@width<600 && @locale="pl") { | |||
<title "Short text"> | <title "Short text"> | ||
<windowDesc "About this app"> | <windowDesc "About this app"> | ||
} | } | ||
</pre> | </pre> | ||
of course it's entirely possible to achieve the same with index and globals: | of course it's entirely possible to achieve the same with index and globals: | ||
<pre> | <pre> | ||
<title[@width<600 ? 'long' : 'short'] { | <title[@width<600 ? 'long' : 'short'] { | ||
| Line 23: | Line 28: | ||
}> | }> | ||
</pre> | </pre> | ||
This syntax would also allow for [[L20n/Features/Import|import command]] to be encapsulated within such a conditional block. | |||
== discussion == | |||
Conditional blocks are at odds with completeness checking. One solution might be to require that the entities in a block are also defined in their default form outside of the block. In this scenario, it might even make sense to use a different keyword, like <code>overload</code> instead of <code>if</code>. | |||
We | We want to see if there will be a need for grouping variations of entities under a condition. For now, we propose to put this feature on hold. Indexes (like <code>title[@width<600 ? 'long' : 'short']</code>) give us the same functionality and actually have a nice feature to them: the entity is defined in one place only. | ||
== status == | |||
* stas - put on hold | |||
* gandalf - for (as @overload) | |||
* pike - against | |||
* code in [https://github.com/zbraniecki/l20n/tree/statements branch "statements"] | |||
This is needed for multilocale resources (Gaia) | |||