forecastie icon indicating copy to clipboard operation
forecastie copied to clipboard

Fix translations

Open robinpaulson opened this issue 6 years ago • 57 comments

In the last few months, we've made many small changes to Forecastie. Some of these have adjusted the user interface, however slightly. However, we haven't updated the translation strings to match. I think it's important we do so, but am unsure how, given the existing Transifex account is not an option.

Suggestions please.

robinpaulson avatar Oct 08 '19 23:10 robinpaulson

I will try to help

Aresiel avatar Oct 16 '19 09:10 Aresiel

I've made an Swedish translation.

Aresiel avatar Oct 16 '19 10:10 Aresiel

Here are some suggestions (maybe there is more than this list):

  1. Edit the strings.xml manually (GitHub online editor, Android Studio or any other editor) Pro: strings.xml can be kept ordered and structured Con: manual copy & paste work (might be cumbersome and error-prone)
  2. Use the Translations Editor in Android Studio Pro: nice point-and-click UI, automatic highlighting of missing texts and not translatable texts Con: translators need Android Studio, content of strings.xml files will unordered
  3. Open a new account on Transifex or another web-based translation service (there are also FOSS tools to host your own translation web app, but this needs an additional web server and makes things too complicated) Pro: web based overview of translation status per language, easy for non-coders Con: might be confusing with the current abandoned Transifex account, risk of loosing again access to an external web service
  4. Automatic translation tools (for example scripts that utilize Google Translate like mentioned in https://stackoverflow.com/questions/44477221) Pro: every language is possible Con: no quality control, bad quality especially for longer texts

I'm personally in favour of 1. and 2., but everything on this list has its advantages. I wouldn't use 4. to add new languages, maybe only if a few texts are missing for a language. But committing texts you don't understand and can't verify feels wrong ...

Concerning the ordered strings.xml file: Currently all files seems to be based on the default English file and share the same logical order of entries and are grouped by empty lines. Using the Translations Editor (and maybe other external tools) this structure will be lost, new translation entries are simply added to the end. Technically this is not a problem, but this makes it harder to work manually with these files.

Important in this case is also which tool is popular with the current/potential Forecastie translators.

FridoDeluxe avatar Oct 16 '19 20:10 FridoDeluxe

I'm not a fan of 2., for the reasons you mention, it's very useful to have the lines associated as blocks, separated by empty lines. We shouldn't arbitrarily discourage those who code by text editor.

I think losing access to transifex or wherever in future isn't necessarily a bad thing, would it be a major problem? At the worst, we are back to where we are now, plus we can always set up another, even if that's not ideal. I am OK with setting that up, then making sure Martykan and/or a successor has the details, in case I decide not to take part in Forecastie any more.

No. 4 is interesting, but as you say needs another approach as well, which means one of the other suggestions you list.

robinpaulson avatar Oct 20 '19 04:10 robinpaulson

Maybe you can ask the guys from weblate if they support your project. It's free for open source projects. I did it for "Etar" and there were no problems;).

Gitsaibot avatar Oct 23 '19 09:10 Gitsaibot

We shouldn't arbitrarily discourage those who code by text editor.

Yes, you're right. Maybe we need to check and refactor all xml files at next opportunity, because even the English on is not perfectly structured anymore.

I think losing access to transifex or wherever in future isn't necessarily a bad thing, would it be a major problem? At the worst, we are back to where we are now, plus we can always set up another, even if that's not ideal.

You're right again. Manually editing combined with using an online translation service seems to be a good solution.

Maybe you can ask the guys from weblate if they support your project. It's free for open source projects. I did it for "Etar" and there were no problems;).

Thanks for the information. Both Transifex and Crowdin also offer free accounts for open source projects. I only know Transifex from a translator's persepective so I can't say which service is most suitable for Android/Github. At least Transifex has the advantage that there are already 53 persons which helped to translate Forecastie in the past.

FridoDeluxe avatar Oct 23 '19 12:10 FridoDeluxe

We shouldn't arbitrarily discourage those who code by text editor.

Yes, you're right. Maybe we need to check and refactor all xml files at next opportunity, because even the English on is not perfectly structured anymore.

I think this is a good starting point. I could do the following for the english version:

  • break the strings.xml into blocks
  • add short comments at the start of each block, explaining what that block does

then as we do the same to more and more of the other translations, missing/wrong strings will become more obvious.

once the manual method is sorted, we can add in an online translation service, the comments will encourage translators not to change the order of individual strings.

robinpaulson avatar Dec 29 '19 02:12 robinpaulson

A first attempt at the groups for strings.xml:

  • Action bar
  • Generic
  • Units ** Temperature ** Length ** Pressure

more todo...

robinpaulson avatar Dec 29 '19 02:12 robinpaulson

then as we do the same to more and more of the other translations, missing/wrong strings will become more obvious.

The Translations Editor inside Android Studio also highlights missing strings. Currently most translatable strings are missing in one or more languages.

add short comments at the start of each block, explaining what that block does

once the manual method is sorted, we can add in an online translation service, the comments will encourage translators not to change the order of individual strings.

Transifex (source) and other translations services support already XML comments. But they are meant as an explanantion for the directly following translation entry, this is already in use in Forecastie's strings.xml. Comments at block start maybe need to be separated by a blank line.

Do you want to manually copy texts from the online translation service? I think all services also provide GitHub integration and automated PRs, but I have no experience if the order of the XML files will be respected.

FridoDeluxe avatar Dec 29 '19 12:12 FridoDeluxe

As I said a few comments back, making sure we can edit translations manually is important to me. I think we should sort that first, then whichever other method we use. Think of it as analogous to the principle that most Unix-like software starts with a library, then a command-line utility, then a GUI application. It's easier to do the basics first, then the more complex later, rather than the other way round. I'm sure the online/more fancy software can do this, we'll get to it later and use those capabilities then.

robinpaulson avatar Dec 29 '19 13:12 robinpaulson

I'm also in favor of being able to manually edit translations. Keeping the structure is also important as it makes it easy to diff against the English translations and quickly find any new strings that have been added.

I used vim's diff mode for comparing the Greek and English translations for PR #443 and the work was quite painless and error-safe. Lines that haven't been translated yet are easy to spot since they appear to have no diff, while lines in the wrong place have a greater diff than expected. Adding this here as a potential workflow for updating translations.

sotpapathe avatar Mar 19 '20 22:03 sotpapathe

Some good suggestions there, @sotpapathe . I like that idea

robinpaulson avatar Mar 20 '20 00:03 robinpaulson

In which case, reordering the lines would be a very useful step forward in tidying the translations. I mentioned previously about putting them in like-minded groups, making them all in the same order is probably the next step after that.

robinpaulson avatar Mar 20 '20 00:03 robinpaulson

I've moved around the strings so they are grouped in what I think is a better way. I'd appreciate anyone who's interested taking a look and giving some feedback/suggesting changes.

robinpaulson avatar Mar 20 '20 01:03 robinpaulson

I like the new grouping but shouldn't the comments be XML-style <!-- --> instead of #?

sotpapathe avatar Mar 20 '20 08:03 sotpapathe

Yes, they probably should. Oddly, it builds fine; I guess the parser is fairly liberal in what it allows. I'll get right on it.

robinpaulson avatar Mar 20 '20 09:03 robinpaulson

OK, done. Unfortunately, @sotpapathe this all means your good work reordering the Greek strings.xml has been undone. Sorry about that, I should have got on to it months ago.

I'll suggest to leave it for a while, there may be other changes as we figure out how best to group the strings. Unless you feel like doing it multiple times that is.....

robinpaulson avatar Mar 20 '20 09:03 robinpaulson

No worries, I can update the order when we have finalized the grouping. In the meantime I am working on a small python script that will display which strings still need to be translated for each language.

sotpapathe avatar Mar 20 '20 10:03 sotpapathe

I am working on a small python script

Marvellous, keep us posted on that. If you're willing to GPL3 it, I'll put it in the git repo.

robinpaulson avatar Mar 20 '20 11:03 robinpaulson

I added the script as PR #444 .

On a sidenote, I would probably be good to have a CONTRIBUTING section with translation guidelines.

sotpapathe avatar Mar 21 '20 10:03 sotpapathe

a CONTRIBUTING section with translation guidelines

yes, any suggestions?

robinpaulson avatar Mar 21 '20 12:03 robinpaulson

a CONTRIBUTING section with translation guidelines

yes, any suggestions?

Maybe this could help, however that one is full of ❤️

adriaaah avatar Mar 21 '20 17:03 adriaaah

Ah, that second link is magnificent. I will certainly adopt the CoC and take a closer look at the contributing guidelines.

robinpaulson avatar Mar 21 '20 23:03 robinpaulson

OK, I've added a CoC as at contributor-covenant.org, suggestions of improvements of course welcome. I'm not sure which translation-specific guidelines would be helpful though, beyond linking to the Transifex page or pointing out the Python script you added. I'll add references to both of those in the contributing.md file.

robinpaulson avatar Mar 22 '20 01:03 robinpaulson

I'll add references to both of those in the contributing.md file.

Done, let me know if it needs more (it probably does)

robinpaulson avatar Mar 22 '20 01:03 robinpaulson

So, I gather anyone can sign up to have their project hosted by weblate service, on their servers. weblate. I'm going to check it out, see if it suits our needs. Apologies if someone mentioned the hosting part and I missed it, this looks interesting,

robinpaulson avatar Mar 31 '20 00:03 robinpaulson

OK, scrub that. Sorry for the misdirection, apparently we have to pay.

robinpaulson avatar Mar 31 '20 01:03 robinpaulson

OK, scrub that. Sorry for the misdirection, apparently we have to pay.

Well, have you contacted Michal? Because as per https://weblate.org/en/hosting/ and based on the complexity of the project (no. of strings and so on) you can have it hosted for free (see right column). Another option (don't know how feasible would be) would be installing it somewhere

adriaaah avatar Mar 31 '20 07:03 adriaaah

Did you send in the request so that @orangesunny can get on it? I'll translate it and see if I find some source strings fixes to make one way or the other once the Cov5 CoC is dropped. #451

comradekingu avatar Mar 31 '20 11:03 comradekingu

@comradekingu uff. This time I can say there is no request from Forecastie. 😀

Fill the form, include some info and I will happily do it :)

Oh and thanks! I am downloading the app to right now 🤓😊

orangesunny avatar Mar 31 '20 11:03 orangesunny