hohMiyazawa / Automail

An enhancement collection for anilist.co
GNU General Public License v3.0
158 stars 31 forks source link

Translate Automail #69

Open hohMiyazawa opened 3 years ago

hohMiyazawa commented 3 years ago

Automail can now be localised through language files (src/data/languages/)

Add a translation if you want to!

There's extra demand for a Japanese translator, as many users will probably be interested in making the UI more Japanese to learn the language faster. You do not have to be fluent, doing this as a learning exercise is perfectly acceptable.

hohMiyazawa commented 3 years ago

As I'm currently integrating the localisation support into the script, here's what you can do for now:

hohMiyazawa commented 3 years ago

Okay, to add a new translation, copy the file "src/data/languages/English.json", rename the copy, and fill in the details.

To be able to build Automail with the new translation active, you also have to add your translation file to "src/localisation.js".

Koopzington commented 3 years ago

so i just checked for new keys to translate and noticed you added various ones for all the languages. I was already a bit skeptic when i saw the $settings_partialLocalisationLanguage_description key and wanted to throw in my two cents on that. There are probably 4 different ways to handle a localization switcher:

I gotta admit the currently used second option doesn't really sit well with me because if you happen to accidently switch the language to one you aren't able to read and a following reload and change of every label could possibly result in you not being able to find your own native language or even the dropdown to change languages in the first place. Also while in this particular case it might be far fetched: Non-native english users could possibly not know the english name of their language, rendering the first option a tiny bit problematic as well. The last two would imo be the best options regarding UX although i wouldn't want to bother with forcing users to download flag icons when text already suffices.

hohMiyazawa commented 3 years ago

The options are already static, the language name translation is actually for the dub marker and the like, not the main language switch.

If you accidentally switch the language, your native language will be represented by its own native name: (current list:)

Anyone speaking one of those languages should be able to find their own.

Flag icons are meh, since there are plenty of cases were there's no equivalence between country and language.


Not changing the description is however maybe a good idea.

Koopzington commented 3 years ago

I'm slowly going through the keys that have been added since the last time i had a look at it and unfortunately couldn't quite find out the location where the $mediaStatus_* keys are being used. Could you tell me the context they're being used in?

hohMiyazawa commented 3 years ago

Looks like I haven't pushed that part yet. They would be used when displaying the "status" as a piece of data, like the status dropdown in the editor window.

hohMiyazawa commented 3 years ago

New feature: translate staff credits. Notes about it in the file /src/data/languages/special_keys.txt

Since there's a potentially infinite number of staff credits, the English language file doesn't have those keys since they are already in English.

Look at the bottom part of the Norwegian.json for an example of how this works.

SoulBlade172 commented 2 years ago

I am interested in contributing to the translation of Automail, specifically the Japanese translation. I have already made a start on adding translations to the Japanese.json file. This is my first time using GitHub for something like this, so I am not too sure on how contributing on GitHub works. I will see if I can add some of the new translations to the json file hosted here. If I make any errors or mistakes, you have my upmost apologies.

I appreciate your time.

kyoyacchi commented 2 years ago

Can I translate Turkish?

hohMiyazawa commented 2 years ago

https://github.com/hohMiyazawa/Automail/pull/184

hohMiyazawa commented 1 year ago

https://github.com/hohMiyazawa/Automail/pull/207 https://github.com/hohMiyazawa/Automail/pull/205

alsoGAMER commented 1 year ago

Some strings in the settings page aren't localized due to them missing from the english file, can we do something about that?

hohMiyazawa commented 1 year ago

@alsoGAMER Yeah, I will try to get those keys added.

If you want to do it yourself, most of the missing keys are in the src/data/legacyModuleDescriptions.json file:

Change entries like these:

{"id": "navbarDroptext",
    "description": "Allow drag-and-drop of text into navbar for search",
    "categories": ["Navigation"]
}

Into:

{"id": "navbarDroptext",
    "description": "$navbarDroptext_description",
    "categories": ["Navigation"]
}

and then add the key to the English.json

"$navbarDroptext_description": "Allow drag-and-drop of text into navbar for search",
alsoGAMER commented 1 year ago

Working on it.

Fixed via #209

hohMiyazawa commented 1 year ago

The list editor can now be translated! About a dozen $editor_* keys, $mediaStatus_planningAnime, $mediaStatus_planningManga, button_save and `button_delete``

hohMiyazawa commented 1 year ago

Added support for translating media titles.

This is off by default, and is behind the "Translate media titles into the script language when available" option on the settings page.

Translating data can be added by adding the keys "mediaTitlesAnime" and "mediaTitlesManga" to a translation file, see the bottom of the Norwegian.json file for an example.

Do not add title translations to languages with official anilist language support (Japanese, Korean, Chinese, English)

nategasm commented 1 year ago

Added support for translating media titles.

Is this only for unofficial titles? I believe Anilist displays all official titles under Synonyms which supports more than just those 4 languages.

hohMiyazawa commented 1 year ago

@nategasm It's for displaying titles (feeds, browse, lists, etc.). Anilist only has three options for that, romaji/native/english

alsoGAMER commented 1 year ago

@hohMiyazawa can you push an update to the greasyfork script?

hohMiyazawa commented 1 year ago

@alsoGAMER I pushed one yesterday. Haven't been using anilist much today, so I haven't done the usual round of checking that everything's okay.

alsoGAMER commented 1 year ago

@hohMiyazawa is normal for translator mode not having the same string count as base english?

image

Update: I'm working on this here and found no issues so far.