openwith icon indicating copy to clipboard operation
openwith copied to clipboard

Translating the WebExtension

Open darktrojan opened this issue 8 years ago • 11 comments

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 the webextension directory. 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/_locales directory. Copy the en/messages.json file into your own directory (e.g. de/messages.json for 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 the details_… strings appear in the add/edit browser form on the options page. Some might be hard to find, for example the icon_… 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.html to installed.html. There's also action.html which 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.

darktrojan avatar Sep 27 '17 23:09 darktrojan

@s8321414 @Cye3s @Matthaiks Here's some info for you if you want to translate the next version before release. Thanks for your help!

darktrojan avatar Sep 27 '17 23:09 darktrojan

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

darktrojan avatar Sep 27 '17 23:09 darktrojan

OK, I will do it in the following days 😄

s8321414 avatar Sep 27 '17 23:09 s8321414

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 avatar Oct 05 '17 14:10 rcmero

@rcmero Use $1 and $2.

darktrojan avatar Oct 07 '17 07:10 darktrojan

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 avatar Nov 13 '17 07:11 private-lock

@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 avatar Nov 13 '17 08:11 darktrojan

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

alexesprit avatar Nov 20 '17 09:11 alexesprit

@darktrojan Crowdin of translation service seems to be able to cooperate with gihub. https://support.crowdin.com/github-integration/

ScratchBuild avatar Nov 22 '17 02:11 ScratchBuild

I downloaded extension, duplicated English file and translated it to Czech language. Can I upload it somewhere?

leschek avatar Nov 24 '17 12:11 leschek

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

    },

miki2207 avatar Dec 16 '17 18:12 miki2207