Thank you for your donation!


Cloudsmith graciously provides open-source package management and distribution for our project.


multi-languages
#1
Hi Tim,

Is there a project to have moode in multi-languages?

Is so I can help to translate in french.

Kind regards
Phil
Reply
#2
Thanks for the offer :-) but although "multi-language" is somewhere on the TODO list there hasn't been a dev to take on the substantial work effort to create and maintain a language string database and modify the code base to use it.
Enjoy the Music!
moodeaudio.org | Mastodon Feed | GitHub
Reply
#3
(05-12-2023, 12:15 PM)Tim Curtis Wrote: Thanks for the offer :-) but although "multi-language" is somewhere on the TODO list there hasn't been a dev to take on the substantial work effort to create and maintain a language string database and modify the code base to use it.

It would be an interesting task... In the past I have done a dynamic dictionary which could change the language without requesting the page again, but:

1. it requires the language strings to be retrieved first

2. it needs all the "translatable" elements, no matter what they are, to have an attribute with which to determine the relevant text to be assigned.

Then it was a matter of something (simplifying...) like the following

Code:
document.querySelectorAll('[dictId]').forEach((item) => {
  item.innerText = getDictionaryTextById(item.attributes['dictId']);
  }
});
Reply
#4
Right. Some sort of key:value table
https://github.com/dakk/jquery-multilang
Enjoy the Music!
moodeaudio.org | Mastodon Feed | GitHub
Reply
#5
See earlier thread https://moodeaudio.org/forum/showthread....light=I18n
Reply
#6
(05-12-2023, 03:34 PM)bitlab Wrote: See earlier thread https://moodeaudio.org/forum/showthread....light=I18n

Good memory :-)
Enjoy the Music!
moodeaudio.org | Mastodon Feed | GitHub
Reply
#7
(05-12-2023, 03:52 PM)Tim Curtis Wrote:
(05-12-2023, 03:34 PM)bitlab Wrote: See earlier thread https://moodeaudio.org/forum/showthread....light=I18n

Good memory :-)

A good tool, probably, but overkill... the whole thing can be done in less than 10 (ten) lines of code. By domain... And 1 JSON file per language, which, IMO, is better for maintenance and growth.

Nevertheless, I can take the job over my shoulders (the biggest part being adding the attribute to every translatable item...), and contribute in Italian (native), and eventually in Spanish (30+ years speaking) and Bulgarian (15+ years speaking) if no natives are to be found in our happy community :-)

P.S.
Don't expect it to be done in one month... but in two or three should be feasible, with at least one translation included (guess which...)
Reply
#8
I18n also support one single file or single file per language.
Don't forget that not all stuff for is in html/js or html templates, but also in php. Especially the configuration stuff.

Also there is difference between translation of static vs dynamics items.

Normally I use the i18n stuff, because it is supported in multiple source code environments. And provide tooling for scanning the code to generate the translation files or check for missing translations, provide good support for plurals, language fallback, strings with variables etc.

Don't think too lightly about good localisation solution.
Reply
#9
Yes, the i18n framework should be used.

It would be best to test this out with just a single PHP template/script and a single modal screen/JS to get a feel for how things work and whether there are any side effects for example broken layout of elements on the page due to longer text strings, slower loading, etc.
Enjoy the Music!
moodeaudio.org | Mastodon Feed | GitHub
Reply
#10
I'd like to offer to contribute Japanese (speaker 15+ years, friends/family native). Please let me know when/how I can start.
Reply


Forum Jump: