Fix pseudolocalization

This commit is contained in:
Alcaro 2016-08-20 23:36:21 +02:00
parent e41aa1f8fe
commit 3899984bbb
4 changed files with 2046 additions and 2052 deletions

View File

@ -229,7 +229,7 @@ OBJ += intl/msg_hash_de.o \
intl/msg_hash_es.o \
intl/msg_hash_fr.o \
intl/msg_hash_it.o \
intl/msg_hash_jp.o \
intl/msg_hash_jp.o \
intl/msg_hash_nl.o \
intl/msg_hash_pl.o \
intl/msg_hash_pt.o

View File

@ -23,6 +23,10 @@
#include "../configuration.h"
#include "../verbosity.h"
#ifdef HAVE_UTF8
#include "msg_hash_uspseudo.c"
#else
int menu_hash_get_help_us_enum(enum msg_hash_enums msg, char *s, size_t len)
{
uint32_t driver_hash = 0;
@ -4470,3 +4474,4 @@ const char *msg_hash_to_str_us(enum msg_hash_enums msg)
return "null";
}
#endif

File diff suppressed because it is too large Load Diff

View File

@ -89,32 +89,16 @@ def pseudolocalize_code(string):
print("/* Autogenerated, do not edit. Your changes will be undone. */")
localize = False
localize = True
for line in sys.stdin:
line = line.strip("\n")
if 'force_iso_8859_1' in line: # nuke this because we're UTF-8 now
continue
elif 'menu_hash_to_str_' in line or 'menu_hash_get_help_' in line:
#line = line.replace("_us", "_pseudo")
if '_label' not in line: localize = True
if localize:
line = pseudolocalize_code(line)
if 'const char *hash_to_str_us_label_enum' in line: localize = False
if 'return "null"' in line: localize = True
if line=='#ifdef HAVE_UTF8': line="#if 0"
if '#include' in line: pass
elif not localize: pass
else: line = pseudolocalize_code(line)
print(line)
# look for const char *menu_hash_to_str_us(uint32_t hash) and add a 'pseudo'
for line in sys.stdin:
line = line.strip("\n")
if 'menu_hash_to_str' in line:
print(line.replace("(", "pseudo("))
break
print(line)
# screw with all strings in the rest of the file
# and add 'pseudo' to int menu_hash_get_help_us(uint32_t hash, char *s, size_t len)
for line in sys.stdin:
line = line.strip("\n")
if 'force_iso_8859_1' in line: pass
elif 'menu_hash_get_help' in line:
print(line.replace("(", "pseudo("))
else:
print(pseudolocalize_code(line))