Giter VIP home page Giter VIP logo

Comments (6)

romanvm avatar romanvm commented on September 18, 2024

Most TinyMCE4 localization files do not use country codes, so passing a full language code will break localization for those languages. I'm aware of the problem with French but haven't thought of a reliable solution for that, except for explicitly setting a language in the widget config. Maybe an additional configuration parameter with custom language mapping? Something like that:

TINYMCE_CUSTOM_LANG_MAPPING = {'fr': 'fr_FR'}

from django-tinymce4-lite.

Gagaro avatar Gagaro commented on September 18, 2024

It would still not work if we have fr-ch in Django, it would give the 'fr_FR' language file.

What about testing if the file exists? If we have 'fr-fr', we first try if 'fr_FR' exists, else we fallback on 'fr'.

I can work on a PR about that.

from django-tinymce4-lite.

Gagaro avatar Gagaro commented on September 18, 2024

By the way, there are 37 language files with a country code and 49 without one.

from django-tinymce4-lite.

romanvm avatar romanvm commented on September 18, 2024

It would still not work if we have fr-ch in Django, it would give the 'fr_FR' language file.

I meant a custom mapping that you can set up as you like. But your idea is better.

By the way, there are 37 language files with a country code and 49 without one.

Yes, that's the problem.

What about testing if the file exists? If we have 'fr-fr', we first try if 'fr_FR' exists, else we fallback on 'fr'.

Sounds good. I guess I will add something like this in the next version.

from django-tinymce4-lite.

romanvm avatar romanvm commented on September 18, 2024

Thanks! I have released v.1.3.1 with this and other improvements, including upgraded TinyMCE 4.

from django-tinymce4-lite.

Gagaro avatar Gagaro commented on September 18, 2024

Thanks for the fast release πŸ‘

from django-tinymce4-lite.

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.