Opened 14 years ago

Closed 14 years ago

#854 closed defect (fixed)

Alternative way of passing dynamic replacements to localization

Reported by: ray Owned by: ray
Priority: normal Milestone:
Component: Xinha Core Version:
Severity: normal Keywords:


The localization system provides the possibilty to localize strings that contain variables. These are passed to the function via js objects. This makes it particularly hard to localize strings containing variables from server-side backends, because you cannot create js objects directly.

I have extended HTMLarea._lc() that it reads possible variables directly from the string.

  • You have the I18N constant "Some text with $variable" : "Some other language text with $variable".
  • You want $variable to be replaced with "replaced text".
  • You pass to the function as first argument "Some text with $variable=replaced text$".
    The _lc parser will grab the variable definition from between the $ signs and builds the appropriate object from it
  • as the result $variable is correctly replaced in both languages

Change History (1)

comment:1 Changed 14 years ago by ray

  • Resolution set to fixed
  • Status changed from new to closed
Note: See TracTickets for help on using tickets.