chenxiaolong / BCR

A Basic Call Recorder for rooted Android devices
GNU General Public License v3.0
1.67k stars 109 forks source link

Translate to Ukrainian language #352

Closed HutsulCoder closed 1 year ago

HutsulCoder commented 1 year ago

Hello i can translate this app, how can i do it?

chenxiaolong commented 1 year ago

Sure, the easiest way right now is:

  1. Copy app/src/main/res/values/strings.xml to app/src/main/res/values-uk/strings.xml and then replace all the English text with Ukrainian text.

  2. Add uk to this list:

    https://github.com/chenxiaolong/BCR/blob/e7cef21326220685921e0c00792f990154f4bea3/app/build.gradle.kts#L114-L125

    and this list:

    https://github.com/chenxiaolong/BCR/blob/e7cef21326220685921e0c00792f990154f4bea3/app/src/main/res/xml/locales_config.xml#L2-L13

  3. Submit a pull request with your changes here on Github and if everything looks good, I'll merge it and include it in the next version of BCR. If you're not familiar with how to submit a PR, feel free to just upload your strings.xml here and I'll do it.

HutsulCoder commented 1 year ago

I can't commit and push changes. I do this with using VS code image

HutsulCoder commented 1 year ago

Git add . Git commit -m "Added Ukrainian language" Git pull origin master Git push origin master

Maybe, need to add new branch?

chenxiaolong commented 1 year ago

Ahh, that's expected because you're trying to push directly to this repo (https://github.com/chenxiaolong/BCR). You'll want to fork this repo (button in top right), change the URL git remote set-url origin <your fork of the repo>), and push there. Then, you'll be able to create a pull request.

EDIT: fixed typo in git command

HutsulCoder commented 1 year ago

strings.zip

HutsulCoder commented 1 year ago

https://github.com/Hutsul-coder/BCR

chenxiaolong commented 1 year ago

Thanks! Can you make a couple changes?

  1. Android uses uk instead of the normal ua for Ukrainian. Please rename ua (or else Android won't be able to detect the translations).

  2. The build currently fails due to:

    BCR/app/src/main/res/values-uk/strings.xml:46: Error: For locale "uk" (Ukrainian) the following quantities should also be defined: few (e.g. "2 дні"), many (e.g. "5 днів") [MissingQuantity]
        <plurals name="retention_days">

    I think this is because the translations currently have:

    <plurals name="retention_days">
        <item quantity="one">Зберегти %d день</item>
        <item quantity="other">Зберегти %d днів</item>
    </plurals>

    I'm not familiar with the language, but it seems that additionally quantity="few" and quantity="many" are required for Ukrainian.

HutsulCoder commented 1 year ago

I fix my mistakes)

chenxiaolong commented 1 year ago

Thanks for the updates! The retention_days is still not quite right:

<plurals name="retention_days">
    <item quantity="one">Зберегти %d день</item>
    <item quantity="two">Зберегти %d дні</item>
    <item quantity="three">Зберегти %d дні</item>
    <item quantity="four">Зберегти %d дні</item>
    <item quantity="other">Зберегти %d днів</item>
</plurals>

Android doesn't accept three and four, but the rest are okay. few and many are required:

<plurals name="retention_days">
    <item quantity="one">Зберегти %d день</item>
    <item quantity="two">Зберегти %d дні</item>
    <item quantity="few">?</item>
    <item quantity="many">?</item>
    <item quantity="other">Зберегти %d днів</item>
</plurals>
HutsulCoder commented 1 year ago

Thanks for the updates! The retention_days is still not quite right:

<plurals name="retention_days">
    <item quantity="one">Зберегти %d день</item>
    <item quantity="two">Зберегти %d дні</item>
    <item quantity="three">Зберегти %d дні</item>
    <item quantity="four">Зберегти %d дні</item>
    <item quantity="other">Зберегти %d днів</item>
</plurals>

Android doesn't accept three and four, but the rest are okay. few and many are required:

<plurals name="retention_days">
    <item quantity="one">Зберегти %d день</item>
    <item quantity="two">Зберегти %d дні</item>
    <item quantity="few">?</item>
    <item quantity="many">?</item>
    <item quantity="other">Зберегти %d днів</item>
</plurals>

Ohh, i understand. I fix this now

chenxiaolong commented 1 year ago

Thanks! Merged in #356