Closed Bug 415243 Opened 16 years ago Closed 16 years ago

Make dynamic variables localizable

Categories

(support.mozilla.org :: General, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: djst, Assigned: nkoth)

References

Details

(Whiteboard: tiki_feature, tiki_upstreamed)

Dynamic variables (e.g. %%myVar%%) should be localizable This could then be used in the same way as DTDs were used in in-product help of Firefox 2.
actually they are %myVar% at the moment. (single percentage). 
Even better (assuming there is a way to escape it).
Depends on: 415288
you are right. %APPDATA% already occurs in existing content and breaks stuff. Let's use %%myVar%% instead.
Dynamic variables in the form %%nameOfVar%% are now language specific. http://support.mozilla.com/kb/Dynamic+variables and all of its translations provide a list of all dynamic variables in the system. They can be used by approvers and locale leaders to change the value of each variable in their language.

I foresee that these could be used like custom dtds.

The main limitation of this feature is now bug 419784.

Status: NEW → RESOLVED
Closed: 16 years ago
Resolution: --- → FIXED
Hey, why was it changed from %var% to %%var%%?

If the only reason was because we're using %appdata%, the easy fix would be to just create a dynvar called %appdata% that escapes to, literally, "%appdata%".
%appdata% was the example I saw that something broke. Not sure if there are any others. It appears quite common for Mozilla docs to use %something%, so to be safe I decided to go with %%dynVar%% instead.
Is this already in Tiki?
Whiteboard: tiki_triage
This is in fact 2 features rolled into one:

1) Allow dynamic variable to be multilingual
2) Allow a way to escape %dynvar% (the problem is that I think all I did was to change the behavior in sumo to use %%dynvar%% instead). Of course we could use the easy fix (more of a workaround) suggested in Comment 5.

the relevant code should be in tikilib. just search for "dynamic var"
Whiteboard: tiki_triage → tiki_feature
Made the enclosing in %% optional with wiki_dynvar_style to 'double'. Default remains 'single'.
Added a preference for the multilingual dynamic variables. wiki_dynvar_multilingual. It causes a behavior change that might not be desired by everyone.
Whiteboard: tiki_feature → tiki_feature, tiki_upstreamed
We aren't actually using the dynvars yet on SUMO, so it feels unnecessary to use %% when we could just as well use % -- the important thing is that there is a way to escape it in case we actually want the ability to show something like %this% in plain text.
To clarify, the important thing here is the preference for multilingual dynamic variables, but the wiki_dynvar_style isn't necessary because we haven't started to use the feature yet and could adapt to the simpler %dynVar% form instead of %%dynVar%%.
Both are done.

As for escaping, ~np~%this%~/np~ should always work.
You need to log in before you can comment on or make changes to this bug.