TiddlyWiki5 icon indicating copy to clipboard operation
TiddlyWiki5 copied to clipboard

[IDEA] Allow plugin.info to have translations

Open linonetwo opened this issue 9 months ago • 3 comments

Is your feature request related to a problem? Please describe.

translate plugin name and description when they are not installed yet

Discussed on feat: t macro and docs https://github.com/Jermolene/TiddlyWiki5/pull/7821#issuecomment-1974850177

Describe the solution you'd like

plugin.info is a JSON (I'm not sure what it become after install, but should be a JSON tiddler too?), so instead of use field like name::fr-FR, we should use

{
  name: 'default name',
  languages: {
    zh-Hans: '中文名',
    fr-FR: 'xxx',
  }
}

Describe alternatives you've considered

I'm afraid flatten field like name::fr-FR will make a long list and difficult to maintain.

Additional context

Make everything fully international.

linonetwo avatar May 01 '24 06:05 linonetwo

Hi @linonetwo the contents of plugin.info is flattened into tiddler fields as plugins are loaded, which implies that the language processing would have to be done as the plugin was constructed under Node.js. So, I think it would be more useful if the available translations were all retained so that the single file configuration of TiddlyWiki could also choose the best language to use.

Jermolene avatar May 01 '24 11:05 Jermolene

How about use JSON-LD standard like

{
 "description": [{
      "@value": "A public university focusing on teaching examples.",
      "@language": "en"
    }, {
      "@value": "Une université publique axée sur l'enseignement d'exemples.",
      "@language": "fr"
    }, {
      "@value": ".جامعة عامة تركز على أمثلة التدريس",
      "@language": "ar",
      "@direction": "rtl"
    }]
}

https://w3c.github.io/vc-data-model/#example-usage-of-the-name-and-description-property-0

linonetwo avatar Aug 22 '24 08:08 linonetwo

Hi @linonetwo the trouble with that approach is that it doesn't fit well with TiddlyWiki's idea of a flat collection of fields; the same issues arise as discussed above.

A more TiddlyWikiesque approach might be:

description@en: A public university focusing on teaching examples.
description@fr: Une université publique axée sur l'enseignement d'exemples.
description@ar@rtl: .جامعة عامة تركز على أمثلة التدريس

Jermolene avatar Aug 22 '24 08:08 Jermolene