Giter VIP home page Giter VIP logo

Comments (7)

cwendling avatar cwendling commented on July 25, 2024

I'm curious what was the rationale for that commit, because indeed it's kind of bound to cause this kind of problems… @rbuj do you remember? Note that what it removes is not a problem in a library, it's not forcing the active domain but setting details on a specific one.

from caja-extensions.

rbuj avatar rbuj commented on July 25, 2024

The internationalization for libraries works differently from how you do it for applications. https://docs.gtk.org/glib/i18n.html

i18n for libraries only require two sentences:

#define GETTEXT_PACKAGE "???"
#include <glib/gi18n-lib.h> 

from caja-extensions.

rbuj avatar rbuj commented on July 25, 2024

@cwendling since the location of the po file cannot be resolved you can revert the commit, leaving bindtextdomain and bind_textdomain_codeset function calls as before merging it.

For a library, you only have to call bindtextdomain() and bind_textdomain_codeset() in your initialization function. If your library doesn’t have an initialization function, you can call the functions before the first translated message.

https://docs.gtk.org/glib/i18n.html

from caja-extensions.

cwendling avatar cwendling commented on July 25, 2024

The internationalization for libraries works differently from how you do it for applications. […]

Yes, but as your second quote states, you still need to call bindtextdomain() (which maps a domain to where the translations are located) and bind_textdomain_codeset() (which declares the codeset for that specific domain) early in your setup.

from caja-extensions.

rbuj avatar rbuj commented on July 25, 2024

There is no problem fetching the messages from the catalog on ubuntu, debian, fedora... imho it's a portability issue. Note bind_textdomain_codeset isn't mandatory. However, since we only provide the catalogs with UTF-8 codeset it's logical to force their coding.

https://www.gnu.org/software/gettext/manual/html_node/Libraries.html

from caja-extensions.

cwendling avatar cwendling commented on July 25, 2024

from caja-extensions.

cwendling avatar cwendling commented on July 25, 2024

OK I checked now I'm on the computer, and it defines the output encoding for the strings returned by gettext, so indeed we want it to be UTF-8 all the time for strings passed to GTK.
It however defaults to the locale encoding, which is likely to be UTF-8 already for reasonable systems, so again, 99.99% of the time it's gonna be correct without it, but it's safer to call it.

from caja-extensions.

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.