GithubHelp home page GithubHelp logo

gettext's Introduction

Erlang Gettext tools for multi-lingual capabilities.

The gettext application makes it possible to internationalize your Erlang
application. The name gettext comes from the GNU package with the same name.
However, the only thing they have in common is the format of the PO-files,
i.e, the files containing the text that can be translated.

Using gettext you can create an initial PO-file containing all the strings
of your application that should be possible to translate. By translating the
strings into some other language and loading the new PO-file into the
gettext database you can adapt your application for different languages.

gettext's People

Contributors

amplexdenmark avatar emafr avatar ericbmerritt avatar happi avatar jcomellas avatar jesperes avatar jordi-chacon avatar k1complete avatar mdaguete avatar msvoboda-ra-rockwell-com avatar richcarl avatar saa avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

gettext's Issues

gettext.erl contains functions specific to the "polish" tool

gettext.erl exports a bunch of functions, mk_polish_style_header() and some additional helpers, that are called from gettext_compile.erl but are also called directly by the "polish" application. It would be much better if this was implemented via a callback, so that the polish-speficic code could stay within polish.

Reload default language,etc.

Hi,

This is more of a question than a issue but given:

?TXT2("Foo", LC) where the key "Foo" exists in default/en shouldn't ?TXT2("Foo", "blah") print the value from default/en? instead of "Foo". If the key doesn't exist in default/en I understand why "Foo" is being printed. Yes, gettext:default_lang() prints "en".

Also, is there a way to reload the default language. Looking through the code it looks like it's only possible to reload a custom language.

Given the above I fail to see the purpose of the default lang vs. having it as a custom lang.

Please, help me grok this.

The use of GETTEXT_TMP_NAME is screwed up

In gettext_compile:parse_transform(), the environment variable GETTEXT_TMP_NAME is read, but is assigned to a variable called Gettext_App_Name which is then concatenated with "lang" and "epot.dets" in mk_epot_fname(). This seems very confused - it's probably some unfinished idea about separate directories for separate applications. Also, there seems to be no good reason for why a "temp" directory should be forced to be under ./lang.

Fails to start under supervision tree

Compiling with rebar3 and erlang 19.3 leads to

$ erl -pa ./_build/default/lib/gettext/ebin/

> gettext_app:start(application, []).
** exception exit: {shutdown,{failed_to_start_child,gettext_server,
                                                    {'EXIT',{function_clause,[{gettext_server,start_link,
                                                                                              [{gettext_server,[]}],
                                                                                              [{file,"/home/nikolay/gettext/_build/default/lib/gettext/src/gettext_server.erl"},
                                                                                               {line,94}]},
                                                                              {supervisor,do_start_child,2,
                                                                                          [{file,"supervisor.erl"},{line,310}]},
                                                                              {supervisor,start_children,3,
                                                                                          [{file,"supervisor.erl"},{line,293}]},
                                                                              {supervisor,init_children,2,
                                                                                          [{file,"supervisor.erl"},{line,259}]},
                                                                              {gen_server,init_it,6,[{file,"gen_server.erl"},{line,304}]},
                                                                              {proc_lib,init_p_do_apply,3,
                                                                                        [{file,"proc_lib.erl"},{line,239}]}]}}}}

Seems to be caused by #15

gettext.app.src is not rebar-friendly

Adding gettext as a rebar dependency fails with this error:

  ERROR: Failed to extract name from 
  /home/al/projects/matome/deps/gettext/src/gettext.app.src: 
  {25, erl_parse,  ["syntax error before: ",  "'.'"]}

gettext.app.src is not a valid erlang config file (it's intended to be processed by Perl in gettext's build). A quick workaround:

  cp ebin/gettext.app src/gettext.app.src

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.