diff options
author | Klaus Schmidinger <vdr@tvdr.de> | 2000-11-18 14:21:41 +0100 |
---|---|---|
committer | Klaus Schmidinger <vdr@tvdr.de> | 2000-11-18 14:21:41 +0100 |
commit | 3e04208de3c7f29e69ff264b557c04074bb9b21c (patch) | |
tree | b3eea94d794155f05702ae6298d5e28229a585f0 | |
parent | 1a5ca67f57beb7c97de1bbdced2c8733a3c29830 (diff) | |
download | vdr-3e04208de3c7f29e69ff264b557c04074bb9b21c.tar.gz vdr-3e04208de3c7f29e69ff264b557c04074bb9b21c.tar.bz2 |
Keeping languages alphabetically; checking for empty strings
-rw-r--r-- | i18n.c | 16 |
1 files changed, 11 insertions, 5 deletions
@@ -4,7 +4,7 @@ * See the main source file 'vdr.c' for copyright information and * how to reach the author. * - * $Id: i18n.c 1.3 2000/11/18 13:28:19 kls Exp $ + * $Id: i18n.c 1.4 2000/11/18 14:21:41 kls Exp $ */ /* @@ -13,7 +13,7 @@ * 1. Announce your translation action on the Linux-DVB mailing * list to avoid duplicate work. * 2. Increase the value of 'NumLanguages'. - * 3. Add a new line to every member of the 'Phrases[]' array, + * 3. Insert a new line in every member of the 'Phrases[]' array, * containing the translated text for the new language. * For example, assuming you want to add the Italian language, * @@ -28,7 +28,10 @@ * "Italiano", * }, * - * and so on. + * and so on. Insert your language so that all the entries + * following 'English' will be sorted alphabetically, and write + * the name of your language in your language (not in English, + * which means that it should be 'Italiano', not 'Italian'). * Note that only the characters defined in 'fontosd.c' will * be available! * 4. Compile VDR and test the new language by switching to it @@ -357,8 +360,11 @@ const char *tr(const char *s) { if (Setup.OSDLanguage) { for (const tPhrase *p = Phrases; **p; p++) { - if (strcmp(s, **p) == 0) - return (*p)[Setup.OSDLanguage]; + if (strcmp(s, **p) == 0) { + const char *t = (*p)[Setup.OSDLanguage]; + if (t && *t) + return t; + } } esyslog(LOG_ERR, "no translation found for '%s' in language %d (%s)\n", s, Setup.OSDLanguage, Phrases[0][Setup.OSDLanguage]); } |