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

Text strings for 2, 3, and 4 #3776

Closed
Valdnet opened this issue Sep 10, 2021 · 9 comments · May be fixed by #3792
Closed

Text strings for 2, 3, and 4 #3776

Valdnet opened this issue Sep 10, 2021 · 9 comments · May be fixed by #3792
Assignees
Labels
approved bug approved by the team enhancement enhancement of a already implemented feature/code feature: 👅 language l10n and translations

Comments

@Valdnet
Copy link
Contributor

Valdnet commented Sep 10, 2021

Add text strings for the number of items for the numbers 3, 4, and 5 in the following text strings:

return tr("%1 minutes").arg(minutesLeft);

return tr("%1 hours").arg(hoursLeft);

return tr("%1 days").arg(daysLeft);

This change is significant for various languages, e.g. in Polish it is as follows:

1 minuta
2 minuty
3 minuty
4 minuty
5 minut

@mgallien
Copy link
Collaborator

is it not a limitation of using tr ?
I guess KI18n framework from KDE's community is working fine for this (at least I know that translators of French are then able to select the correct form).
could you have a look to see how well it is working for Polish ?

@Valdnet
Copy link
Contributor Author

Valdnet commented Sep 10, 2021

@mgallien For other text strings, it is possible to translate both singular and plural.
Sample text string:

obraz

} else if (minutes == 1) {
return (QObject::tr("%n minute ago", "", minutes));
} else {
return (QObject::tr("%n minutes ago", "", minutes));

However, for the above-mentioned strings, this is not possible. This is probably due to the code.

obraz
obraz
obraz

@mgallien
Copy link
Collaborator

@Valdnet do you want to work on a patch ?
I am a bit short on the time available to do it myself in a reasonable time frame

@Valdnet
Copy link
Contributor Author

Valdnet commented Sep 13, 2021

do you want to work on a patch ?

I could, but the change probably requires more coding knowledge.

@Valdnet
Copy link
Contributor Author

Valdnet commented Sep 13, 2021

@mgallien Sample of code change:

        if (minutesLeft == 1) {
            return tr("%1 minute", "", minutesLeft);
        } else {
            return tr("%1 minutes", "", minutesLeft);
        }

Is my logic right? Do I need to improve anything else?

@mgallien
Copy link
Collaborator

@Valdnet yes but in this case should you not also add context to help translators ?

@Valdnet
Copy link
Contributor Author

Valdnet commented Sep 14, 2021

@mgallien Well. I will take care of this and add context for the translators.

@Valdnet Valdnet self-assigned this Sep 14, 2021
Valdnet added a commit that referenced this issue Sep 14, 2021
Changing text strings to correctly import them into Transifex.
Issue #3776.

Signed-off-by: Valdnet <[email protected]>
@Valdnet
Copy link
Contributor Author

Valdnet commented Sep 14, 2021

Changes made.

@mgallien Please check if it's okay. I did not add context for the translators because they are simple text strings that do not require detailed explanation for their meanings.

@FlexW FlexW added approved bug approved by the team enhancement enhancement of a already implemented feature/code labels Sep 27, 2021
@FlexW FlexW linked a pull request Sep 27, 2021 that will close this issue
mgallien pushed a commit that referenced this issue Sep 28, 2021
tell tr that there is a number inside the translated string such that
translators can provide the proper plural forms

Changing text strings to correctly import them into Transifex.
Issue #3776.

Signed-off-by: Valdnet <[email protected]>
nextcloud-command pushed a commit that referenced this issue Feb 7, 2022
tell tr that there is a number inside the translated string such that
translators can provide the proper plural forms

Changing text strings to correctly import them into Transifex.
Issue #3776.

Signed-off-by: Valdnet <[email protected]>
camilasan pushed a commit that referenced this issue May 11, 2022
tell tr that there is a number inside the translated string such that
translators can provide the proper plural forms

Changing text strings to correctly import them into Transifex.
Issue #3776.

Signed-off-by: Valdnet <[email protected]>
mgallien pushed a commit that referenced this issue Jun 3, 2022
tell tr that there is a number inside the translated string such that
translators can provide the proper plural forms

Changing text strings to correctly import them into Transifex.
Issue #3776.

Signed-off-by: Valdnet <[email protected]>
Valdnet added a commit that referenced this issue Jun 10, 2022
tell tr that there is a number inside the translated string such that
translators can provide the proper plural forms

Changing text strings to correctly import them into Transifex.
Issue #3776.

Signed-off-by: Valdnet <[email protected]>
Valdnet added a commit that referenced this issue Jun 12, 2022
tell tr that there is a number inside the translated string such that
translators can provide the proper plural forms

Changing text strings to correctly import them into Transifex.
Issue #3776.

Signed-off-by: Valdnet <[email protected]>
mgallien pushed a commit that referenced this issue Jun 29, 2022
tell tr that there is a number inside the translated string such that
translators can provide the proper plural forms

Changing text strings to correctly import them into Transifex.
Issue #3776.

Signed-off-by: Valdnet <[email protected]>
Valdnet added a commit that referenced this issue Jun 30, 2022
tell tr that there is a number inside the translated string such that
translators can provide the proper plural forms

Changing text strings to correctly import them into Transifex.
Issue #3776.

Signed-off-by: Valdnet <[email protected]>
joshtrichards pushed a commit that referenced this issue Aug 15, 2024
tell tr that there is a number inside the translated string such that
translators can provide the proper plural forms

Changing text strings to correctly import them into Transifex.
Issue #3776.

Signed-off-by: Valdnet <[email protected]>
@Rello
Copy link
Contributor

Rello commented Nov 8, 2024

this can not be implemented for technical reasons

@Rello Rello closed this as not planned Won't fix, can't repro, duplicate, stale Nov 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved bug approved by the team enhancement enhancement of a already implemented feature/code feature: 👅 language l10n and translations
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants