Questions tagged [gettext]

Gettext is an internationalization and localization (i18n) library which is commonly used for writing multilingual programs. Its most popular implementation is that of the GNU project.

Gettext is an internationalization and localization (i18n) library which is commonly used for writing multilingual programs. Its most popular implementation is that of the GNU project.

I18n with gettext works by marking up translatable strings in the source code, usually by wrapping them with a function call. The xgettext tool extracts these strings and creates a text file listing them. This file is called the template and its name usually ends in ".pot".

The msginit tool creates a new text file mapping the extracted strings to their translation in a given locale, having the ".po" extension. Finally the msgfmt tool creates an optimized representation of the translation mappings that is then used at runtime. For most programs this is a binary file ending in ".mo", but it is also possible to create other formats, for example a java ResourceBundle.

There are specialized editors for editing the ".mo" files, which can remember already translated strings and contain databases of repeatedly used words.

1756 questions
0
votes
1 answer

Gettext isnt translating the text in php

I'm at a loss of what I'm doing wrong. Gettext is enabled, according to phpinfo(). I have checked out the locales that the system uses and generated the danish ones, so the language alias exists in the system. I don't know if I have set things up…
Ntikki
  • 293
  • 3
  • 15
0
votes
1 answer

Gettext not working on wamp upon updating

I have recently updated my wamp server (32 bit). Gettext was perfectly working but immediately after the upgrade, it stopped and i am thus now not able to view the localized version of my website (unlike before). I have of course used the 32 bit…
Josealonso14
  • 37
  • 1
  • 6
0
votes
3 answers

PHP use gettext to translate an array

I have a web page in PHP and I'm translating with gettext _("STRING_TO_TRANSLATE"). I have in my DB one table with all user profiles for my website. I put them in a selection box to choose one. Now I want to translate the profile names. Is there…
Jorge B.
  • 1,144
  • 2
  • 17
  • 37
0
votes
1 answer

How to make ngettext() works using the php-gettext library?

I am using the php-gettext library. Following the tutorial here, I have set up the _gettext() function require_once("locale/gettext.php"); require_once("locale/streams.php"); $locale_file = new…
user2335065
  • 2,337
  • 3
  • 31
  • 54
0
votes
1 answer

Getting error on gettext from edittext?

I'm making a simple application that changes images when a certain string is typed in a dialog box but when I try to get the string from edit text(in the dialog) the application stops and gives an error public class MainActivity extends Activity…
Kakashi sama
  • 19
  • 1
  • 3
0
votes
1 answer

How to translate part of text in html with i18n?

I am trying to use i18next to translate my app, which has some html checkboxes. here is the html code:

Beijing, Shanghai, Guangzhou...

enoughtoo
  • 1
  • 1
0
votes
2 answers

Edit Text to String Not Saving What's Typed

After extensively trying to figure out why my SharedPreferences are always blank, or never created. I have concluded that it is because the edit text to string isn't doing anything, yet I have no idea why it isn't doing anything. Here is the…
I'm_With_Stupid
  • 1,112
  • 4
  • 16
  • 35
0
votes
1 answer

INTLTOOL_EXTRACT breaks translatable lines

I don't know why but my source code line and the one in the pot file are not the same, source code: #include #define _(String) gettext(String) /* more code */ printf (_("Error while saving file in %s:\n\n%s"), ...); Now, in the pot…
Joel
  • 1,805
  • 1
  • 22
  • 22
0
votes
2 answers

getText from GUI textfield error in java

I am doing a project where I have to convert a fraction into its lowest terms. I am experiencing errors with .getText from a JTextField. I printed their input and the input is being received as the properties rather than as a string. I am having…
Adam
  • 433
  • 5
  • 9
0
votes
1 answer

Why Is App Force Closing When I Submit Text?

I'm going from no programming experience to learning Android. I'm doing the online tutorials from Google using Eclipse with ADT plugin. The last tutorial in the beginners section is having the user input a statement and starting a new activity that…
0
votes
1 answer

Choosing a method for designing multilingual website

I designed multilingual websites before and I used some php files for languages. for example: lang/en.php lang/fr.php and then use…
MajAfy
  • 3,007
  • 10
  • 47
  • 83
0
votes
0 answers

Localize PHP with PO file

I am basic programer in php. I want to use PO/MO file for build a multi language example in php But when I am calling gettext functions (__() or _e()) Stay in that function for ever. I Uses poedit GUI for edit .po files and configured poedit as…
Majid
  • 39
  • 1
  • 11
0
votes
0 answers

Gettext php - how to translate this value?

I need to implement Gettext. If I have to translate

Title:

I can use the following:

Which is pretty simple for single word of sentences in PHP files. However how can I implement the above Gettext…
Pikk
  • 2,343
  • 6
  • 25
  • 41
0
votes
1 answer

PHP gettext return non utf8 string in Linux platform

I am using gettext _('someString') to do i18n, and it is working fine in my windows dev XAMPP platform; However, when I upload to a Linux CentOS hosting, my program display the translated in non utf-8 string. For example, in Chinese version, it…
Garrick
  • 1
  • 2
0
votes
1 answer

How to get text out of TextView or ListView Android?

I have a ListView. This ListView load this text/data from a URL/HTML code on a webpage. I use a for loop for it like: for (int i = 0; i < 5; j++) { // Search and load text in the ListView.. } But sometimes the webpage has 5 "textfields" but…
KD-21
  • 255
  • 2
  • 6
  • 16
1 2 3
99
100