Giter VIP home page Giter VIP logo

Comments (8)

ddnexus avatar ddnexus commented on May 14, 2024 1

Updated the CHANGELOG (1f3087b)

from pagy.

ddnexus avatar ddnexus commented on May 14, 2024 1

Thanks for the explanation. Then it looks like you are using the i18n extra... and I just understood that my doc is not clear enough then :).

I will update also the initializer_example.rb to make it more clear.

You don't need that 2 lines if you use the i18n extra, because your app is using the canonical I18n gem included as a dependency of rails, hence that 2 lines are totally ignored by the I18n gem.

from pagy.

ddnexus avatar ddnexus commented on May 14, 2024

Hi @msdundar
sorry for the issue, but there have been some simple to fix breaking changes in version 0.11.0. Please, follow the CHANGELOG link to update. Please, let me know if I can help.

Besides, I just noticed that the CHANGELOG missed to report to update also the initializer file. I will fix the CHANGELOG.

Thanks

from pagy.

ddnexus avatar ddnexus commented on May 14, 2024

@msdundar
I saw that you are using a custom language. The new Pagy version has been refactored in order to better support custom i18n, especially with regard to multiple languages and relative pluralization.

If the file you are using is generic (i.e. suitable for general use), then you could add your language to the bottom of the pagy.yml file and create a pull request. ;)

If your language doesn't use the same "en" default pluralization types (i.e. 'zero', 'one', 'other'), you should also add a proc in the plurals.rb, so it will be properly pluralized by pagy i18n.

Please, let me know if I can help. Thanks

from pagy.

msdundar avatar msdundar commented on May 14, 2024

Thanks for your quick reply, detailed explanation and update on CHANGELOG.

I will make a PR for translations soon. My issue is fixed, after changing the initializer as shown below:

Pagy::Frontend::I18N.load(file:'config/locales/gems/pagy/tr.yml', language:'tr')
Pagy::Frontend::I18N.load(file:'config/locales/gems/pagy/en.yml', language:'en')

best regards.

from pagy.

ddnexus avatar ddnexus commented on May 14, 2024

I suppose that the 2 lines are from 2 apps, right? Because there is no support for dynamic translation of multiple languages in the current pagy internal i18n. And if you are using the i18n extra (i.e. the canonical I18n gem), then that 2 lines are not used at all by the pagination.

from pagy.

msdundar avatar msdundar commented on May 14, 2024

In fact, they are from the same application and it worked well :) I am not using any additional translation-globalization GEMs, just default i18n bundled with Rails and ActiveSupport. When I switch between locales I can see the translated pagination texts without any problems.

from pagy.

ddnexus avatar ddnexus commented on May 14, 2024

Updated initializer_example.rb (cdab354)

from pagy.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.