tdulcet / Thunderbird-Send

📤 FileLink provider for Send (formerly Firefox Send)
https://addons.thunderbird.net/thunderbird/addon/filelink-provider-for-send/
Mozilla Public License 2.0
43 stars 8 forks source link

Localization proposal #13

Closed DenB10 closed 1 month ago

DenB10 commented 1 month ago

Hi,

I use several extensions for Thunderbird and like to have them translated into my language (French in this case). I also like your Thunderbird Send extension. I've also had fun implementing its localization. The result is attached below. Take a look. You can dispose of it as you see fit, and even throw it away if you're not interested.

filelink_provider_for_send-2.0-tb (with localization).zip

Best regards,

DenB

tdulcet commented 1 month ago

Wow, thank you for your work on this! 🙏 This is a major contribution, that should make it much easier for others to translate this add-on into their native language as well. It is something I have wanted to do for a while, but have never had the time. I am glad to hear that you had fun doing it.

If you can, I would encourage you to submit a pull request, so you could get credit for your work. It also would make it easier for me to see your changes. From briefly reviewing the files, I believe you could simplify/combine many of these messages by using the placeholders feature, which may make it easier for people to translate as well. See here for an example. In addition, all of my localized add-ons use the TinyWebEx Localizer library, which should make it easier for you to localize the HTML files.

I am planning to release a new version 2.1 in the next couple of months, sometime before the release of Thunderbird 128, so we should be able to get this integrated before then.

DenB10 commented 1 month ago

@tdulcet

First of all, thank you for the warm welcome you gave my proposal, and then for the advice you gave me.

I'm in the process of revising the entire localization system based on "TinyWebEx Localizer", which I've integrated in the right place.

A quick note on the "placeholders" feature: it works fine from JavaScript but not (or at least I haven't managed to) from HTML. For example, in the management.html file, a link is included in a sentence, so I got around the problem by linking the whole sentence.

You suggest I make a pull request. How can I do this? I've already made a fork of your project. Do I need to submit changes file by file on this fork? Note that this is to make it easier for you to compare the changes, not to give me credit, because I don't care about that.

tdulcet commented 1 month ago

No problem, thanks again for all your efforts!

Regarding adding placeholders to the HTML, there is an example on how to do this here. In short, you would just need to add a data-opt-i18n-keep-children tag to the parent element.

Regarding a pull request, just clone your fork, add the Localizer library, update the files as needed and then commit and push the changes:

git clone --recurse-submodules https://github.com/DenB10/Thunderbird-Send.git
git submodule add https://github.com/TinyWebEx/Localizer common/modules/Localizer
# Update files as needed
git add .
git commit
git push origin

This would add all of your changes in a single commit. Then from your fork on GitHub, there should be a button to create a new pull request. Please let me know if you need any help.

DenB10 commented 1 month ago

I've definitely learned a lot! I managed to add placeholders to the management.html file. I've also managed to add or update files in my Thunderbird-Send fork (by hand, via upload).

But I'm having trouble adding the Localizer sub-module. I've finally realized that I need a software program to do this. But I don't! In the past, I've contributed to several projects on Github, but I've never needed any particular software.

Don't get me wrong: I'm just a modest translator who learns bits and pieces of programming by tinkering and observing. What do you suggest I do now?

tdulcet commented 1 month ago

Nice, this is a huge help. Hopefully what you learned is also helpful for translating those other Thunderbird extensions you mentioned.

Yeah, you would need to use a git client to add a submodule. If you have git installed, you could just run those commands I provided above. Otherwise, no worries, I can easily add this library myself after you create the pull request.

Whenever you are ready, please go ahead and create the PR and I will review your changes, so we can get this merged. As you probably know, there is a website that makes it very easy for people to do the translations for add-ons once they are localized, so your efforts will be a huge help for them.

DenB10 commented 1 month ago

I've already made a PR but without the Localizer submodule (I'll leave it to you to install it). I hope I didn't make a mistake. In any case, it works fine on my computer.

No, I didn't know lusito.github.io. Another thing you've taught me!