GuruSR/Watchy_GSR

Help with German translation / localization

Opened this issue · 5 comments

I just installed your watchface and I really like it.
It's impressive that you managed to put so many functions in to the Watchy.
While setting everything up, I saw that you are preparing for localization.
I can't help much, but I could translate everything into German.

Not sure if it is ready for translation yet, so let me know if I can contribute.

The Locale_GSR file has functions in it that contain all the text for both the Watchy and the Web, can German be done without accents or special fonts? If no then a font may need to be created for it to match the existing ones. Look over the Locale_GSR file and see what you can understand. I'm tempted to have it offer an override for font selection as well, not sure yet, but when the language is changed it does a reconfig for the display, to update anything necessary.

In Locale_GSR, you'll see "LangID" a lot, and "case 0", case 0 is "English". There are GetFormatID that returns the format of Weekday or Month and Date, that entire string is used to display those, so any prefix words can be used. Next is GetID which uses the LangID (for the case # within the switch function) for the language for Watchy text (used in the Watchy), the next one is GetWebID, that itself uses the Web interface for the language (meaning accents should work). GetWebLang supplies the web browser with the language for the OTA Website interface that GetWebID uses for the text. GetLangName returns the menu item for the current language, here you can put the translation in for the language too (remember, no accents are available). GetWeekday, GetShortWeekday, GetMonth and GetShortMonth are all Watchy based items (again, accent-less) and are there so the days can be properly changed. What you would do is:

Copy the "case 0" completely in each section, then paste it just after the original "case 0" and change the case to 1, add a line before your case 1 and type: break; on it then translate those sets for case 1, making sure to put in the Language name. When you've done that, go into the top function and change MaxLangID to return 1. Save, compile and try it. If it works, then fantastic, if it does need another font, then more work would need to be done.

An example, so you can see what I mean:

        switch(LangID){
            case 0:{
                switch(ID){
                   case 0:
                      return "{W}"; // Weekday.
                   case 1:
                      return "{M} {D}";  // Month & Date
                }
            }
            break; // add this before your case 1.
            case 1:{   // translate your case 1.
                switch(ID){
                   case 0:
                      return "{W}"; // Weekday.
                   case 1:
                      return "{M} {D}";  // Month & Date
                }
            }

        }
        return "None";
    };

With your explanation, extending the switch-case should be easy enough.

I'm a web-dev, so my C/C++ knowledge is limited. If this were for the web, I would throw all localization variables in a JSON file.
Could make the translation process easier. Switch-case is easy for a couple of languages, but will grow with every language.

But as I said, I'm coming from the web and compiler are still kind of witchcraft for me.

What do you think? Am I overthinking this?

Btw: As a web-dev, I can't resist the urge to improve the web UI. I found the files with the styles and structure, I think.
Don't worry. Nothing huge and no external libraries needed. But in general, are there unusual limitations or quirks I should be aware off? Like filesize or something browser-unrelated? Just to be sure.

Well, if you have issues, you can actually just translate the text in the quotes, the WebID ones, translate with respect to websites, the WebLang is the 2 letter indicator for web languages, think gb is it? You can always DM me the translations on discord then I can do the updates to make the language changes. And do you think you could find a way around jquery and just utilize what I want out of jquery without having to download it each time, I'd like to only include what I actually need.

I did leave a comment, but I'll do so again, since it seems to have vanished. I am on the discord for the Watchy, so maybe discussing the finer things of web dev would be best there. As for JSON files for languages, the issue becomes difficult when people who add to the Watchy GSR base code using the Override will lose out on being able to intercept translations (when I get that part written), so they too can take advantage of translating their Override for the languages around.