Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Localisation updates from https://translatewiki.net. #2562

Merged
merged 2 commits into from
Jan 29, 2021
Merged

Conversation

translatewiki
Copy link
Member

Translation updates

@codecov
Copy link

codecov bot commented Dec 17, 2020

Codecov Report

Merging #2562 (30a06f5) into develop (f7b5d52) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##             develop    #2562   +/-   ##
==========================================
  Coverage      39.84%   39.84%           
  Complexity        31       31           
==========================================
  Files            286      286           
  Lines           7348     7348           
  Branches         899      899           
==========================================
  Hits            2928     2928           
  Misses          4114     4114           
  Partials         306      306           

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update f7b5d52...30a06f5. Read the comment docs.

@translatewiki translatewiki force-pushed the translatewiki branch 2 times, most recently from 7331407 to 8a0320d Compare December 29, 2020 07:54
@translatewiki translatewiki force-pushed the translatewiki branch 2 times, most recently from f1a487d to 5297a0a Compare January 7, 2021 14:22
@kelson42 kelson42 requested a review from abdulwd January 9, 2021 21:28
core/src/main/res/values-fr/strings.xml Outdated Show resolved Hide resolved
@translatewiki translatewiki force-pushed the translatewiki branch 2 times, most recently from ae59f21 to 96a7622 Compare January 14, 2021 14:55
@kelson42
Copy link
Collaborator

@abdulwd Looks like we have the same problem as with the ndl PR here as well

@translatewiki translatewiki force-pushed the translatewiki branch 2 times, most recently from 3725bd5 to af1dd24 Compare January 21, 2021 14:11
@kelson42 kelson42 self-requested a review January 25, 2021 09:50
kelson42
kelson42 previously approved these changes Jan 25, 2021
@kelson42
Copy link
Collaborator

@s-ayush2903 We seem to have a porblem with the % character escaping. But if I look to the source code, it is not convincing, it is partly blackslashed, partly not, see:

$ grep -r pref_text_zoom_summary *
core/src/main/res/values-tr/strings.xml:  <string name="pref_text_zoom_summary">Metin boyutunu %25\'lik artışlarla değiştirin.</string>
core/src/main/res/values-ru/strings.xml:  <string name="pref_text_zoom_summary">Изменить размер текста с шагом 25%</string>
core/src/main/res/values-pt-rBR/strings.xml:  <string name="pref_text_zoom_summary">Altere o tamanho do texto com incrementos de 25%.</string>
core/src/main/res/values-sc/strings.xml:  <string name="pref_text_zoom_summary">Càmbia sa mannària de su testu cun ismanniamentos de su 25%.</string>
core/src/main/res/values-fr/strings.xml:  <string name="pref_text_zoom_summary">Modifier la taille du texte par incrément de 25 %.</string>
core/src/main/res/values-ar/strings.xml:  <string name="pref_text_zoom_summary">تغيير حجم النص بزيادة مقدارها 25%.</string>
core/src/main/res/values-diq/strings.xml:  <string name="pref_text_zoom_summary">Ebatê metin  %25 zeydnayışana bıvurnê</string>
core/src/main/res/values-iw/strings.xml:  <string name="pref_text_zoom_summary">לשנות את גודל הטקסט בקפיצות של 25%.</string>
core/src/main/res/values/strings.xml:  <string name="pref_text_zoom_summary">Change text size with 25\% increments.</string>
core/src/main/res/values-uk/strings.xml:  <string name="pref_text_zoom_summary">Змінити розмір тексту з 25-відсотковим кроком.</string>
core/src/main/res/values-qq/strings.xml:  <string name="pref_text_zoom_summary">Tell the user that this preference changes the text size in 25% increments.</string>
core/src/main/res/values-ku/strings.xml:  <string name="pref_text_zoom_summary">Mezinahiya nivîsê bi bilindkirinên 25% biguherîne.</string>
core/src/main/res/values-sv/strings.xml:  <string name="pref_text_zoom_summary">Ändra textstorlek med steg på 25%.</string>
core/src/main/res/xml/preferences.xml:      android:summar$ grep -r pref_text_zoom_summary *
core/src/main/res/values-tr/strings.xml:  <string name="pref_text_zoom_summary">Metin boyutunu %25\'lik artışlarla değiştirin.</string>
core/src/main/res/values-ru/strings.xml:  <string name="pref_text_zoom_summary">Изменить размер текста с шагом 25%</string>
core/src/main/res/values-pt-rBR/strings.xml:  <string name="pref_text_zoom_summary">Altere o tamanho do texto com incrementos de 25%.</string>
core/src/main/res/values-sc/strings.xml:  <string name="pref_text_zoom_summary">Càmbia sa mannària de su testu cun ismanniamentos de su 25%.</string>
core/src/main/res/values-fr/strings.xml:  <string name="pref_text_zoom_summary">Modifier la taille du texte par incrément de 25 %.</string>
core/src/main/res/values-ar/strings.xml:  <string name="pref_text_zoom_summary">تغيير حجم النص بزيادة مقدارها 25%.</string>
core/src/main/res/values-diq/strings.xml:  <string name="pref_text_zoom_summary">Ebatê metin  %25 zeydnayışana bıvurnê</string>
core/src/main/res/values-iw/strings.xml:  <string name="pref_text_zoom_summary">לשנות את גודל הטקסט בקפיצות של 25%.</string>
core/src/main/res/values/strings.xml:  <string name="pref_text_zoom_summary">Change text size with 25\% increments.</string>
core/src/main/res/values-uk/strings.xml:  <string name="pref_text_zoom_summary">Змінити розмір тексту з 25-відсотковим кроком.</string>
core/src/main/res/values-qq/strings.xml:  <string name="pref_text_zoom_summary">Tell the user that this preference changes the text size in 25% increments.</string>
core/src/main/res/values-ku/strings.xml:  <string name="pref_text_zoom_summary">Mezinahiya nivîsê bi bilindkirinên 25% biguherîne.</string>
core/src/main/res/values-sv/strings.xml:  <string name="pref_text_zoom_summary">Ändra textstorlek med steg på 25%.</string>
core/src/main/res/xml/preferences.xml:      android:summary="@string/pref_text_zoom_summary"
core/src/main/res/values-in/strings.xml:  <string name="pref_text_zoom_summary">Ubah ukuran teks dengan penambahan 25%</string>
core/src/main/res/values-mk/strings.xml:  <string name="pref_text_zoom_summary">Промени големина на текст во стапки од 25 %.</string>
core/src/main/res/values-pl/strings.xml:  <string name="pref_text_zoom_summary">Zmień rozmiar tekstu co 25%.</string>
core/src/main/res/values-zh-rTW/strings.xml:  <string name="pref_text_zoom_summary">以 25% 更改文字大小</string>
y="@string/pref_text_zoom_summary"
core/src/main/res/values-in/strings.xml:  <string name="pref_text_zoom_summary">Ubah ukuran teks dengan penambahan 25%</string>
core/src/main/res/values-mk/strings.xml:  <string name="pref_text_zoom_summary">Промени големина на текст во стапки од 25 %.</string>
core/src/main/res/values-pl/strings.xml:  <string name="pref_text_zoom_summary">Zmień rozmiar tekstu co 25%.</string>
core/src/main/res/values-zh-rTW/strings.xml:  <string name="pref_text_zoom_summary">以 25% 更改文字大小</string>

Here I read that the escaping character for % should be %.... https://stackoverflow.com/questions/21164214/error-message-incorrect-formatting-string-missing-conversion-character-in.

So what is the right thing to do?

@s-ayush2903
Copy link
Contributor

Ah yes, that's the problem with translatewiki I don't know why they always tend to offend our staticAnalysis checks, I remember this correctly, Sean used to fix these un-necessary changes made by translatewiki on his own in their PRs, this problem looks very identical to me to the ones that sean used to fix. I'll attach a fix here that can be used to make staticAnalysis check green. Have a look at this commit or to be more clear, you may have a look at #2550, here, in the first commit pushed by the translation community, they introduced the needless change and it caused static check to fail, sean fixed it in the next commit. I believe the problem also here is very same as this one(reason: same error in the runs,

  • for the one that I mentioned: 1550695464
  • failing staticAnalysis run for the current PR: 1760995263) .

Also, if we consider the SO answer, I'm skeptical if it pleases our static checks as we have this check customized specifically for our project, and we shouldn't merge/approve any PR that fails staticAnalysis or does not meet our green build criteria, as on being merged in the mainstream/develop they'll cause all future builds to fail(whether it be on any PR or any commit or some scheduled check/run like nightly).

@kelson42
Copy link
Collaborator

@Nikerabbit @Abijeet Do we know why the TW version of the master string in English does not contain any backslash https://translatewiki.net/w/i.php?title=Kiwix:Android.ui.pref_text_zoom_summary/en&action=edit whereas source code has a backslash https://github.com/kiwix/kiwix-android/blob/develop/core/src/main/res/values/strings.xml#L257 ?

@Nikerabbit
Copy link

https://developer.android.com/guide/topics/resources/string-resource#FormattingAndStyling doesn't say anything about needing to escape %-signs. We convert character escapes to literals for translator convenience. Maybe we need to limit which ones to convert.

@kelson42
Copy link
Collaborator

The problem seems complex. The percentage character is obviously reserved (see explanation in the link given in previous comment) and needs somehow to be escaped. It seems we are not the only one with this problem, see miracle2k/android2po#26.

@kelson42
Copy link
Collaborator

@Nikerabit I believe this SO answer to be helpful: https://stackoverflow.com/a/4417333. Would TW be able to handle properly the XML attribute formatted="false"?

@Nikerabbit
Copy link

@kelson42 I think that would be https://phabricator.wikimedia.org/T244494. I marked it as high priority, but it will take some time, so it won't be the immediate solution. What workarounds can we do in the meanwhile? Make sure that \% is not converted to %?

@kelson42
Copy link
Collaborator

@Nikerabbit The only other solution reported in SO comment is to use %% and call res.getString("pref_text_zoom_summary", null).
@s-ayush2903 Does that the best thing to do for you too?

@s-ayush2903
Copy link
Contributor

s-ayush2903 commented Jan 27, 2021

I won't be happy with the SO answer, because even if we use it there ain't very high chances that it'll pass the staticAnalysis check, even if it passes and when we'll merge it, then it'll create a confusion between contributors regarding the discrepancies and the pattern we are following at some place and not following the same at others, and at the end of the day when this problem will be fixed in upstream then we'll have a PR that'll revert the changes introduced in this PR(only the ones that crept in via SO answer), that doesn't sound cool to me; because if we look on the other side, the problem we have in current PR is quite easy to fix manually, like the person working on this PR just needs to replace the occurrences of % with /% only(via ctrl+r or some custom keybinding for the same change in the editor they prefer) and just push the commit that's it we're done, this is a quite easy to implement fix without relying upon the future work on the upstream ticket and a new PR too, this also won't break the pattern we already have in our codebase, these were my two cents on the proposal

@kelson42
Copy link
Collaborator

he person working on this PR just needs to replace the occurrences of % with /% only

Yes, two times a week.... This is easy, but not substainable and we can not expect translators to but a backslash if there is none in the original English version.

@kelson42
Copy link
Collaborator

BTW I'm not even sure why I propose works as this string is used directly in the UI XML:

  <SeekBarPreference
      android:defaultValue="2"
      android:max="6"
      android:summary="@string/pref_text_zoom_summary"
      app:iconSpaceReserved="false"
      app:key="text_zoom"
      app:title="@string/pref_text_zoom_title"
      app:updatesContinuously="true" />

I don't know how to to avoid the Formatter there.

@kelson42
Copy link
Collaborator

@s-ayush2903 I have manually fixed the XML file, but now sdkmanager can not be found. Seems to be a new error! Any clue? The problem seems not related to that PR.

@s-ayush2903
Copy link
Contributor

s-ayush2903 commented Jan 28, 2021

Just checked this is a problem with reactive-circus runners, they've fixed in the next version, using the new version should fix the problem.
Context: ReactiveCircus/android-emulator-runner#123

@s-ayush2903
Copy link
Contributor

Doesn't look like it worked, I've pinged 'em, awaiting a response from their end.

@s-ayush2903
Copy link
Contributor

s-ayush2903 I have manually fixed the XML file, but now sdkmanager can not be found. Seems to be a new error! Any clue? The problem seems not related to that PR.

Tracked in #2587

@kelson42 kelson42 merged commit 7aa9140 into develop Jan 29, 2021
@kelson42 kelson42 deleted the translatewiki branch January 29, 2021 11:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants