FHEM Forum

FHEM => Frontends => FHEMapp => Thema gestartet von: gvzdus am 12 April 2021, 22:34:40

Titel: Internationalization
Beitrag von: gvzdus am 12 April 2021, 22:34:40
Let's write in English in this thread. Already 2 persons raised an interest in making FHEM App international.

What would be a lean approach for this? Very basic idea:

IMHO this should be simple. Is your impression this requires more than:

...
Do you think it would take more than having a simple language / template replacer? E.g., from public/cfg/templ_shutter.json, changing:
      "text": ["motor:up:öffnet...","motor:down:schließt...","pct:1:offen","pct::geschlossen"],

to
      "text": ["motor:up:$OPENING$","motor:down:CLOSING","pct:1:$OPEN$","pct::$CLOSED$"],

and a "de.json" language file:
{ "OPENING": "öffnet...", "CLOSING":"schließt ...", "OPEN": "offen", "CLOSED": "geschlossen" }

etc. ?
Titel: Antw:FHEM App - Internationalization
Beitrag von: gvzdus am 12 April 2021, 23:09:38
Other option: A systematic approach, like:
https://www.codeandweb.com/babeledit/tutorials/how-to-translate-your-vue-app-with-vue-i18n (https://www.codeandweb.com/babeledit/tutorials/how-to-translate-your-vue-app-with-vue-i18n)
Titel: Antw:FHEM App - Internationalization
Beitrag von: jemu75 am 12 April 2021, 23:45:59
Zitat von: gvzdus am 12 April 2021, 23:09:38
Other option: A systematic approach, like:
https://www.codeandweb.com/babeledit/tutorials/how-to-translate-your-vue-app-with-vue-i18n (https://www.codeandweb.com/babeledit/tutorials/how-to-translate-your-vue-app-with-vue-i18n)

I think, this is the right way and easy to implement in FHEM App. Now I need a bit time to build a solution.  ;)
Titel: Antw:FHEM App - Internationalization
Beitrag von: moustic999 am 13 April 2021, 08:08:12
Zitat von: gvzdus am 12 April 2021, 23:09:38
Other option: A systematic approach, like:
https://www.codeandweb.com/babeledit/tutorials/how-to-translate-your-vue-app-with-vue-i18n (https://www.codeandweb.com/babeledit/tutorials/how-to-translate-your-vue-app-with-vue-i18n)

I think this is the best solution.

Zitat von: jemu75 am 12 April 2021, 23:45:59
I think, this is the right way and easy to implement in FHEM App. Now I need a bit time to build a solution.  ;)

I will prepare most obvious translation already.
Titel: Antw:FHEM App - Internationalization
Beitrag von: jemu75 am 13 April 2021, 08:33:08
Zitat von: moustic999 am 13 April 2021, 08:08:12
I think this is the best solution.

I will prepare most obvious translation already.

thanks for your support  :)
On the next step i check the possible sources of content at the application.
I think mainly we have three sources
1)  fhem self -> e.g. Attributes like "room", "group", "alias" or special formatted values from readings
2) the Application self -> e.g. Navigation Items like "Räume", "Gruppen", "System", "Home"
3) the Template Definitions -> e.g. Elements like text, text2 on the main-part or the text-items on the info-part

May be the third point could be a bit difficult, because the solution should be generic. But i think, it is possible to find a good way to solve this :)
Titel: Antw:FHEM App - Internationalization
Beitrag von: moustic999 am 13 April 2021, 14:35:31
Zitat von: jemu75 am 13 April 2021, 08:33:08

2) the Application self -> e.g. Navigation Items like "Räume", "Gruppen", "System", "Home"


This is the most critical and top priority on my list.
Titel: Antw:FHEM App - Internationalization
Beitrag von: jemu75 am 16 April 2021, 14:36:39
Hi guys, with the new release (v3.12.0) i have implemented the i18N Plugin. Now you can use FHEMApp as "multilanguage-App" :) At the first Step you can choose between english and german language. But it's not a problem to implement other languages. We only have to fill the "translation-file". At the second step i also include the "multilanguage-function" in user defined templates. Please test the new feature and give me feedback :)
Titel: Antw:Internationalization
Beitrag von: moustic999 am 18 Oktober 2021, 20:50:43
Sorry for so late feedback, but translation of the menu works fine; I have it in english.

The biggest missing point is translation for template, for instance light is stick to "aus" "an", havind translation for this would be great !

Titel: Antw:Internationalization
Beitrag von: jemu75 am 18 Oktober 2021, 21:01:46
Zitat von: moustic999 am 18 Oktober 2021, 20:50:43
Sorry for so late feedback, but translation of the menu works fine; I have it in english.

The biggest missing point is translation for template, for instance light is stick to "aus" "an", havind translation for this would be great !

The translation within the templates is not yet implemented. But you can easily customize each template. You can find them in the "cfg" directory.
Titel: Antw:Internationalization
Beitrag von: moustic999 am 19 Oktober 2021, 19:58:36
Zitat von: jemu75 am 18 Oktober 2021, 21:01:46
The translation within the templates is not yet implemented. But you can easily customize each template. You can find them in the "cfg" directory.

that's what I made, and it works fine by changing in template