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

fix regarding not using the correct plural number when checking if a plural form is translated #93

Open
wants to merge 9 commits into
base: master
Choose a base branch
from

Conversation

donseba
Copy link

@donseba donseba commented Jan 10, 2024

Is this a fix, improvement or something else?

This pull request addresses issue #92 by fixing a bug in the IsTranslatedN() and IsTranslatedNC() functions, which previously failed to utilize the do.pluralForm(n) method. This resulted in incorrect checks against the msgstr[N] instead of the appropriate plural form.

What does this change implement/fix?

This change rectifies the issue, enabling you to correctly verify the existence of a translation and subsequently retrieve it or display a placeholder as needed. Here's an example of how this can be used in Go:

    if language.IsTranslatedN("hello stargazer", 99) {
         return language.GetN("hello stargazer", "hello to all %d stargazers", 99, 99)
    }else{
        return fmt.Sprintf("*%s*(%d)", "hello stargazer", 99)
    }

I have ...

  • answered the 2 questions above,
  • discussed this change in an issue,
  • included tests to cover this changes.

@leonelquinteros
Copy link
Owner

The PR changes all imports, it can't be merged as it is now.

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.

None yet

2 participants