Translating the WebExtension
Open With will soon be released as a WebExtension. Here's some notes on how to translate it.
-
If you're okay working with Git, clone the repo to your machine. You can install it in Firefox temporarily by visiting
about:debugging. Choose thewebextensiondirectory. This is probably the easiest way to check your changes, and you can reload as you go. -
Otherwise start by getting the WebExtension from here so you know what you're looking at.
-
Locales live in the
webextension/_localesdirectory. Copy theen/messages.jsonfile into your own directory (e.g.de/messages.jsonfor German) to begin. In GitHub when you create a new file in your own fork the directory will be created also, if you type it right. -
I've tried to organise the strings in a logical way, e.g. all the
browserList_…strings appear in the list of browsers and thedetails_…strings appear in the add/edit browser form on the options page. Some might be hard to find, for example theicon_…ones only pop up when your mouse is over the icon selection box. -
Some strings only appear when first installed. You can see those by visiting the options page, then changing the address from
options.htmltoinstalled.html. There's alsoaction.htmlwhich is the usual toolbar popup. -
Complicated bits like this:
"test_success": {
"message": "Found version $VERSION$ at $LOCATION$.",
"placeholders": {
"location": {
"content": "$2",
"example": "/home/geoff/Desktop/open_with_linux.py"
},
"version": {
"content": "$1",
"example": "7.0"
}
}
},
can be reduced in your copy to:
"test_success": {
"message": "Found version $1 at $2.",
},
The extra information is to make it easier for humans to understand what is going on. In fact, message is the only piece it's necessary to keep for any of the values.
- If you want to keep the English version of a string, remove it from your file.
If you have any questions, I can answer them here.
@s8321414 @Cye3s @Matthaiks Here's some info for you if you want to translate the next version before release. Thanks for your help!
@leschek @lucasgsilva @muflone @private-lock @aguador @Krzysiu @DenDan777 @rcmero @goofy-bz
Hello Open With translation helpers! I've had to completely rewrite Open With and plan to release it in the upcoming weeks. If you'd like to translate it before it's released to most users, in this thread is some information to help with that.
If you're no longer interested, I understand that. You might want to unsubscribe from this thread so you don't get spammed with more email messages.
Thanks very much everybody. I'm sure my users like having Open With in their own language. :-)
OK, I will do it in the following days 😄
Let me take a look at that, and I'll see what I can do.
EDIT: I was taking a look at your post and one part got me a bit confused.
"test_success": {
"message": "Found version $VERSION$ at $LOCATION$.",
},
"test_success": {
"message": "Found version $1 at $2.",
},
In this case, when writing the placeholder text, should I use $1 and $2 or $VERSION$ and $LOCATION$?
@rcmero Use $1 and $2.
It seems zoo2translate is broken? I've updated the translations, but it won't create the pull-request. It seems the last pull-request from 2015 is hindering it. https://zoo2translate.herokuapp.com/darktrojan/openwith/de
@private-lock Yeah, it's long dead. The only reason it's still accessible is because I haven't got around to turning it off.
@darktrojan What do you think about translation platforms, e.g. Transifex? They have pretty comfortable translation editor, auto-update source file from remote URL (GitHub project) and some other useful features. I think this could make translation to other languages a bit easier.
@darktrojan Crowdin of translation service seems to be able to cooperate with gihub. https://support.crowdin.com/github-integration/
I downloaded extension, duplicated English file and translated it to Czech language. Can I upload it somewhere?
Thank you for your great work! It's make life easier :) I made small update to Polish translation for ver86 (16 Dec 2017)
-
"backup_button": {
-
"message": "Kopia zapasowa…" -
},
-
"backup_description": {
-
"message": "New Tab Tools utworzy plik zawierający Twoje ustawienia, przypięte kafeki oraz obraz tła." -
},
-
"backup_header": {
-
"message": "Kopia zapasowa:" -
},
-
"backup_restore_button": {
-
"message": "Kopia zapasowa/Przywracanie ustawień…" -
},
"restore_button": { "message": "Przywracanie ustawień" }, "restore_description": { "message": "Wybierz plik kopii zapasowej New Tab Tools, aby przywrócić ustawienia." }, "restore_header": { "message": "Przywracanie ustawień:" }, "restore_warning": { "message": "Ta operacja usunie obecne ustawienia, przypięte kafelki oraz obraz tła i nie będzie możliwości powrotu do nich."
},