Automail icon indicating copy to clipboard operation
Automail copied to clipboard

Translate Automail

Open hohMiyazawa opened this issue 3 years ago • 21 comments

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 avatar May 01 '21 14:05 hohMiyazawa

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

  • Reply here to show interest in being a translator.
  • Learn git

hohMiyazawa avatar May 01 '21 14:05 hohMiyazawa

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".

hohMiyazawa avatar May 02 '21 13:05 hohMiyazawa

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:

  • Always show english label and english names of languages
  • Change label and options depending on which language is currently used
  • Have an english label and use the respective native name of a language in the dropdown (e.g. "Deutsch, English, Espagnol, Français)
  • Super fancy: Use country flag icons in the dropdown

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.

Koopzington avatar May 21 '21 10:05 Koopzington

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:)

  • English
  • Português
  • Deutsch
  • 日本語
  • Åarjelsaemie
  • Norsk

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.

hohMiyazawa avatar May 21 '21 19:05 hohMiyazawa

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?

Koopzington avatar Sep 14 '21 18:09 Koopzington

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 avatar Sep 15 '21 09:09 hohMiyazawa

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.

hohMiyazawa avatar Sep 15 '21 10:09 hohMiyazawa

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.

SoulBlade172 avatar Dec 14 '21 02:12 SoulBlade172

Can I translate Turkish?

kyoyacchi avatar Sep 05 '22 12:09 kyoyacchi

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

hohMiyazawa avatar Sep 06 '22 17:09 hohMiyazawa

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

hohMiyazawa avatar Jan 12 '23 00:01 hohMiyazawa

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

alsoGAMER avatar Jan 12 '23 12:01 alsoGAMER

@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",

hohMiyazawa avatar Jan 12 '23 12:01 hohMiyazawa

Working on it.

Fixed via #209

alsoGAMER avatar Jan 12 '23 13:01 alsoGAMER

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

hohMiyazawa avatar Jan 12 '23 19:01 hohMiyazawa

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)

hohMiyazawa avatar Jan 13 '23 09:01 hohMiyazawa

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.

nategasm avatar Jan 13 '23 09:01 nategasm

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

hohMiyazawa avatar Jan 13 '23 09:01 hohMiyazawa

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

alsoGAMER avatar Jan 15 '23 17:01 alsoGAMER

@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.

hohMiyazawa avatar Jan 15 '23 19:01 hohMiyazawa

@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.

alsoGAMER avatar Jan 23 '23 17:01 alsoGAMER