yanus171 / Handy-News-Reader

Handy News Reader is a light and modern Android feed reader, based on Flym News Reader
Other
194 stars 23 forks source link

Suggestion for translation project #144

Closed DerSaxxe closed 5 years ago

DerSaxxe commented 5 years ago

What are you thinking about managing translation at OneSky?

https://sirsteiner.oneskyapp.com/collaboration/project?id=154734

ThomasLeigh commented 5 years ago

The most important thing is that I'd like to be the only person to handle both Polish and English translation. Could it be done?

DerSaxxe commented 5 years ago

No problem. I manage "my" translators ;-) Tomorrow we can try it...

yanus171 commented 5 years ago

Is it free?

yanus171 commented 5 years ago

Can we still discuss English strings on github?

DerSaxxe commented 5 years ago

OneSky is not free but if you don't need professional translators it doesn't cost anything. There you can find many other apps like meteogram, lithium, musicolet...

DerSaxxe commented 5 years ago

... and yes, why not discuss here and translate at OneSky

DerSaxxe commented 5 years ago

Another option could be transifex.com but here you can't edit the souce (english) language

ThomasLeigh commented 5 years ago

For Me it is not so important where to discuss the translation - what could make a difference is if I could be automatically notified every time some new strings have arrived, and know what they are, and be able to translate them right off the bat. This could be much helpful.

DerSaxxe commented 5 years ago

Notifications are not a problem. At the moment I think transifex could be the better choice because you can link it with github. The project https://github.com/barbeau/gpstest also use it. Transifex is free for open source projects. @yanus171 Do you know this platform?

ThomasLeigh commented 5 years ago

But we need to be able to edit the source language as well. Regardless of what language we set as the default one (the source).

DerSaxxe commented 5 years ago

The workflow should be:

  1. Discuss at GitHub (if needed)
  2. Edit source language, commit, pull request at GitHub
  3. If configured (via Travis CI) changes in source language resources (at GitHub) will be updated automatically (at Transifex).
  4. Translators gets notifications (from Transifex) about changed/new strings.
  5. If 100% translated in any language Transifex commits the xml file(s) to GitHub

Transifex also checks syntax, so I found some mistakes in plurals:

/FlymFork/src/main/res/values-zh/strings.xml Error while uploading translation: b"Could not import file: Invalid plural types for string: number_of_new_entries. Language supports: ['other'], but found: ['one', 'other'] instead."

/FlymFork/src/main/res/values-pl/strings.xml Error while uploading translation: b"Could not import file: Invalid plural types for string: number_of_new_entries. Language supports: ['one', 'few', 'many', 'other'], but found: ['one', 'other'] instead."

/FlymFork/src/main/res/values-cs/strings.xml Error while uploading translation: b"Could not import file: Invalid plural types for string: number_of_new_entries. Language supports: ['one', 'few', 'many', 'other'], but found: ['one', 'few', 'other'] instead."

/FlymFork/src/main/res/values-sk/strings.xml Error while uploading translation: b"Could not import file: Invalid plural types for string: number_of_new_entries. Language supports: ['one', 'few', 'many', 'other'], but found: ['one', 'few', 'other'] instead."

ThomasLeigh commented 5 years ago

For Me https://sirsteiner.oneskyapp.com seems to look good (I would need to test it more deeply to clarify if it is in fact friendly enough - but I need to know what the official choice will be), and - more importantly - it looks comprehensive, non-techy user friendly.

DerSaxxe commented 5 years ago

You can also test translation at Transifex https://www.transifex.com/sirsteiner/handy-news-reader-flymfork/

ThomasLeigh commented 5 years ago

What about the access to the English translation?

DerSaxxe commented 5 years ago

At Transifex there is no access to the source language. But there are some tipps how to handle this: https://community.transifex.com/t/can-i-change-the-source-strings-in-transifex/92

yanus171 commented 5 years ago

Explain me please why are you concerned with such tools. Our strings updates are not so intensive (last prefs reconfiguration is exclusion). Is it hard to make pull request on github?

DerSaxxe commented 5 years ago

Even it is not hard to make pull request for me because I played with GitHub since years, it is much easier managing translations with these tools.

  1. You can add new strings to the source language and translators gets notifications.
  2. Translators gets notifications if a developer changes a strings to update them.
  3. It's easy to add new languages and invite a translator who is not a developer.
  4. You and the translators can notice the translation progress.

I help in translation to german language of many project and all of them using any tool (OneSky, Crowdin, Transifex, GetLocalization...). It is much better - believe me.

DerSaxxe commented 5 years ago

P.S.: You could add a link to the translation project in Handy to invite translators and add more languages. It's easier to find translators if the number of strings are small. Later it could be difficult if there are (maybe) more than thousand strings.

ThomasLeigh commented 5 years ago

If Alexey will give it a chance and if the source language will be changed to some other one in order to have the access to the English translation - I'm willing to give a try.

Is this tool always up-to-date with the source language file from GitHub?

DerSaxxe commented 5 years ago

The sync from GitHub to Transifex can be automated with Travis CI. Both (Transifex integration and Travis CI) must configured by Alexey. It is not so easy if he never did it. If he don't want it OneSky is an easy option. Everytime the source language is changed one of us had to upload the new strings.xml and Alexey can download the translated files everytime he needs for a new release.

yanus171 commented 5 years ago

@SIRSteiner can you configure the sync and make a pull request?

yanus171 commented 5 years ago

And a link to translation project can be added by a pull request

DerSaxxe commented 5 years ago

@yanus171 I did some tests and it works. But you cannot setup integration with pull requests because transifex and travis ci needs access to your repo. Therefore if you want that it is in your hand you have to do some things. But if you don't want this I can do it for you with my repo and I can make pull requests if needed. What do you think?

DerSaxxe commented 5 years ago

P.S.: If I should it do for you then you should send me a notification if you change the source language

yanus171 commented 5 years ago

And if I will do it in my repo I would not have to notify Travis about string changes?

DerSaxxe commented 5 years ago

No, everytime you commit changes the commands in .travis.yml are running. It boots a virtual machine at travis, install transifex client and makes a "tx push -s" to push changes in source language to transifex. You could also push changes in translation that way to transifex but it would make no sense because translators have to put their changes at transifex.

If you don't know how to setup, I can help you step by step.

Here you can see my latest "build" at travis as I removed the unused string: https://travis-ci.org/SIRSteiner/Flym/builds/526651368

DerSaxxe commented 5 years ago

Which os you are running at your local machine? I hope linux...

yanus171 commented 5 years ago

Windows :)

DerSaxxe commented 5 years ago

I don't know how you work with Windows and local git. Is it similar to linux? Is it also a commandline tool?

yanus171 commented 5 years ago

Yes, command line shell, where I exec all git * commands. It comes with official git distributive for Windows.

Also Android Studio has git and github integration

DerSaxxe commented 5 years ago

Okay we can also start without installing the local transifex client I think. Are you ready to start? Here are the first steps:

Note: please merge my pull request #151 without config files or nothing at all

  1. Login at transifex.com with your GitHub-Account and authorize transifex. 1.1 Follow instructions, don't forget to click "Are you translating open source content..." at the bottom of "Company/Organisation" dialog and create a project:

    • Handy News Reader
    • public project
    • open souce
    • URL to GitHub repo
    • file-based project
    • choose source language (en)
    • choose no target languages
    • don't upload anything, we will do it later via travis ci 1.2 Generate a token in user settings - API token and copy/save token (you will need it later and it will be hidden after closing the window)
  2. Login at travis-ci.org with your GitHub-Account and authorize travis 2.1 Enable repository at your account settings 2.2 Go to settings of your enabled repository and add the following secret environment variables

    • TRANSIFEX_API_TOKEN with the saved value from 1.2

Next steps are the config files. Tell me if you are ready

yanus171 commented 5 years ago

I found on Transifex site that there is a free 15 days trial. So is this a paid service?

DerSaxxe commented 5 years ago

Please read this: https://docs.transifex.com/projects/open-source-project Thats why I wrote

don't forget to click "Are you translating open source content..." at the bottom of "Company/Organisation" dialog

yanus171 commented 5 years ago

I have done your actions. Whats next?

DerSaxxe commented 5 years ago

Perfect. Now look at the .tx/config at repo. There you can find two sections [handy-news-reader.strings-xml] and [handy-news-reader.arrays-xml] If you named the project "Handy News Reader" at transifex you should find "handy-news-reader" in the url like transifex.com/sirsteiner/handy-news-reader/dashboard/ If you named the project other than "Handy News Reader" you have to change .tx/config Do you have to change .tx/config?

yanus171 commented 5 years ago

I have no need to change config. Url https://www.transifex.com/sirsteiner/handy-news-reader/ shows me language translation percentages. Thank you for help. What next?

DerSaxxe commented 5 years ago

No I mean your URL to transifex not sirsteiner

DerSaxxe commented 5 years ago

In the meanwhile I updated cs and sk to prevent import error at transifex. Please merge my latest commit

DerSaxxe commented 5 years ago

As you can see at #153 there runs the script but something went wrong. But we will find the reason.

  1. What is the url to your transifex project?
  2. Please look at https://travis-ci.org/yanus171/Flym/settings Did you add the var TRANSIFEX_API_TOKEN ?
yanus171 commented 5 years ago
  1. As I wrote https://www.transifex.com/sirsteiner/handy-news-reader/
  2. Yes I have added that var
yanus171 commented 5 years ago

Sorry, url is https://www.transifex.com/a-250/handy-news-reader-1/dashboard/

DerSaxxe commented 5 years ago

Okay, you have to change the two section headings .tx/config [handy-news-reader.strings-xml] and [handy-news-reader.arrays-xml]

to

[handy-news-reader-1.strings-xml] and [handy-news-reader-1.arrays-xml]

DerSaxxe commented 5 years ago

Should I do it for you?

yanus171 commented 5 years ago

done

DerSaxxe commented 5 years ago

Now look here: https://github.com/yanus171/Flym/pull/153#partial-pull-merging Let's have a look: https://travis-ci.org/yanus171/Flym/builds/527015590?utm_source=github_status&utm_medium=notification Please click at restart build to see if .tx/config the problem was

DerSaxxe commented 5 years ago

Now it works: https://travis-ci.org/yanus171/Flym/builds/527040628 Please look at transifex. There you should see the source language?

yanus171 commented 5 years ago

I merged pull request manually (I shouldn't do it?) , after that I restarted build and it failed.

yanus171 commented 5 years ago

Sorry I need to interrupt now till tomorrow

DerSaxxe commented 5 years ago

Okay till tomorrow evening

DerSaxxe commented 5 years ago

One "problem" is that everytime you get a pull request travis build starts. You have to disable it in travis settings for flym "Build pushed pull requests": https://travis-ci.org/yanus171/Flym/settings

Before you merge my latest pull request you have to check api token because your latest travis build says:

tx ERROR: Authorization Required Error: Authentication failed. Please make sure your credentials are valid.

If you lost your transifex api token you can regenerate it here: https://www.transifex.com/user/settings/api/

After regenerating go to travis https://travis-ci.org/yanus171/Flym/settings and remove the old var TRANSIFEX_API_TOKEN and add it again with the new api token as value.

Then merge my latest pull request and you should see all translation files at transifex. If so, remove the last line from .travis.yml and nearly all things are done.

Good night