Snippet Namespace in the Core

Does anybody know why the text editor snippets are under $:/language/ namespace?

4 matches
$:/language/Snippets/ListByTag
$:/language/Snippets/MacroDefinition
$:/language/Snippets/Table4x3
$:/language/Snippets/TableOfContents

I expect something like this $:/core/texteditor/Snippets/ListByTag

So they can be swapped out when you select a different language plugin.

For example:

  • Go to $:/ControlPanel > Plugins
  • Press “Get more plugins” button
  • Select “Languages” tab
  • Choose a language – e.g., “fr-FR: Français (France)” – and press “install”
  • Close “Get more plugins” modal window (button will now be labelled “fermer”)
  • Go to $:/ControlPanel > Info
  • Scroll down to “Hello! Current Language” setting
  • Choose “Français (France)” from the drop list

Now, when you view the $:/language/Snippets/* tiddlers, all user visible text appears in French instead of English.

Note that language translations are NOT applied to “keyword” syntax such as filter operator names, macro names, tag values, HTML, etc.

-e

1 Like

Many thanks for clarifications @EricShulman

But can’t we just translate captions and use something like $:/language/Buttons/Bold/Caption for bold button, etc.

language - a language plugin (see TranslationMechanism). Only the language plugin named in the tiddler $:/language is activated at any one time (along with any dependent language plugins)

So one language simply replaces all language tiddlers with a different set.

I wish there were documentation on how to write solutions with the features for possible translation into other languages, without actually creating the translation, but to make it easy for others to do so.

1 Like