Internationalization - xarvh/squarepants GitHub Wiki

Given that:

  • Internationalization is important for accessibility and hence for SP
  • It is usually faster to develop apps without multi-language support
  • Adding multi-language at a later time often requires rewriting a lot of code and hunting for stray strings

then it would be great if SP had an easy way to allow adding multi-language support on apps that were not designed for it.

A partial solution to this requirement could be to have a way to replace hard-coded Text according to language baked in directly in the compiler.

For example, we could have a way to tag a Text as "to be internationalized", then the system could expose a function to load a new translation and automatically replace all flagged Text (and output a list of missing tags and unused tags).

The flag could also contain metadata about contextual information that could be useful for translations.

--> Problem: how do we make clear that a flagged Text is actually used as a tag and therefore should not be modified? --> Or: what happens when a flagged text is changed and we lose reference to all its translations?

--> Also, this goes against SP's "no mutable state" guarantee and breaks referential transparency.