Remove msg_hash_uspseudo
This commit is contained in:
parent
feef0d19b9
commit
efe0220df2
|
@ -510,12 +510,6 @@ ifeq ($(HAVE_LAKKA), 1)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifeq ($(HAVE_MENU_COMMON), 1)
|
ifeq ($(HAVE_MENU_COMMON), 1)
|
||||||
ifeq ($(PSEUDOLOC), 1)
|
|
||||||
PSEUDO_NS := pseudo
|
|
||||||
else
|
|
||||||
PSEUDO_NS :=
|
|
||||||
endif
|
|
||||||
|
|
||||||
OBJ += menu/menu_driver.o \
|
OBJ += menu/menu_driver.o \
|
||||||
menu/menu_content.o \
|
menu/menu_content.o \
|
||||||
menu/menu_input.o \
|
menu/menu_input.o \
|
||||||
|
|
|
@ -23,10 +23,6 @@
|
||||||
#include "../configuration.h"
|
#include "../configuration.h"
|
||||||
#include "../verbosity.h"
|
#include "../verbosity.h"
|
||||||
|
|
||||||
#ifdef HAVE_PSEUDOLOCALIZE
|
|
||||||
#include "msg_hash_uspseudo.c"
|
|
||||||
#else
|
|
||||||
|
|
||||||
int menu_hash_get_help_jp_enum(enum msg_hash_enums msg, char *s, size_t len)
|
int menu_hash_get_help_jp_enum(enum msg_hash_enums msg, char *s, size_t len)
|
||||||
{
|
{
|
||||||
uint32_t driver_hash = 0;
|
uint32_t driver_hash = 0;
|
||||||
|
@ -4690,4 +4686,3 @@ const char *msg_hash_to_str_jp(enum msg_hash_enums msg)
|
||||||
|
|
||||||
return "null";
|
return "null";
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
|
@ -23,10 +23,6 @@
|
||||||
#include "../configuration.h"
|
#include "../configuration.h"
|
||||||
#include "../verbosity.h"
|
#include "../verbosity.h"
|
||||||
|
|
||||||
#ifdef HAVE_PSEUDOLOCALIZE
|
|
||||||
#include "msg_hash_uspseudo.c"
|
|
||||||
#else
|
|
||||||
|
|
||||||
int menu_hash_get_help_us_enum(enum msg_hash_enums msg, char *s, size_t len)
|
int menu_hash_get_help_us_enum(enum msg_hash_enums msg, char *s, size_t len)
|
||||||
{
|
{
|
||||||
uint32_t driver_hash = 0;
|
uint32_t driver_hash = 0;
|
||||||
|
@ -4692,4 +4688,3 @@ const char *msg_hash_to_str_us(enum msg_hash_enums msg)
|
||||||
|
|
||||||
return "null";
|
return "null";
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -1,104 +0,0 @@
|
||||||
#!/usr/bin/env python
|
|
||||||
# coding=UTF-8
|
|
||||||
|
|
||||||
# RetroArch - A frontend for libretro.
|
|
||||||
# Copyright (C) 2011-2016 - Daniel De Matteis
|
|
||||||
#
|
|
||||||
# RetroArch is free software: you can redistribute it and/or modify it under the terms
|
|
||||||
# of the GNU General Public License as published by the Free Software Found-
|
|
||||||
# ation, either version 3 of the License, or (at your option) any later version.
|
|
||||||
#
|
|
||||||
# RetroArch is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
|
|
||||||
# without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
|
|
||||||
# PURPOSE. See the GNU General Public License for more details.
|
|
||||||
#
|
|
||||||
# You should have received a copy of the GNU General Public License along with RetroArch.
|
|
||||||
# If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
|
|
||||||
# You probably don't need this script. It's only needed to update menu_hash_uspseudo.c,
|
|
||||||
# and that's not necessary either, because outdated translations fall back to English.
|
|
||||||
|
|
||||||
# Usage: ./pseudolocalize.py < msg_hash_us.c > msg_hash_uspseudo.c
|
|
||||||
|
|
||||||
replacements = {
|
|
||||||
# These characters all exist in ISO-8859-1.
|
|
||||||
#" ": "´¨¯¸",
|
|
||||||
"!": "¡",
|
|
||||||
"?": "¿",
|
|
||||||
"a": "áàâåäã",
|
|
||||||
"A": "ÁÀÂÅÄÃ",
|
|
||||||
"c": "ç",
|
|
||||||
"C": "Ç",
|
|
||||||
"D": "Ð",
|
|
||||||
"e": "éèêë",
|
|
||||||
"E": "ÉÈÊË",
|
|
||||||
"i": "íìîï",
|
|
||||||
"I": "ÍÌÎÏ",
|
|
||||||
"n": "ñ",
|
|
||||||
"N": "Ñ",
|
|
||||||
"o": "óòôöõø",
|
|
||||||
"O": "ÓÒÔÖÕØ",
|
|
||||||
"u": "úùûü",
|
|
||||||
"U": "ÚÙÛÜ",
|
|
||||||
"y": "ýÿ",
|
|
||||||
"Y": "Ý",
|
|
||||||
}
|
|
||||||
|
|
||||||
import sys,random
|
|
||||||
|
|
||||||
if sys.version_info >= (3, 0):
|
|
||||||
import io
|
|
||||||
sys.stdin = io.TextIOWrapper(sys.stdin.buffer, encoding='ISO-8859-1')
|
|
||||||
sys.stdout = io.TextIOWrapper(sys.stdout.buffer, encoding='ISO-8859-1')
|
|
||||||
else:
|
|
||||||
import codecs
|
|
||||||
sys.stdin = codecs.getreader('ISO-8859-1')(sys.stdin)
|
|
||||||
sys.stdout = codecs.getwriter('UTF-8')(sys.stdout)
|
|
||||||
|
|
||||||
nreplacements = {}
|
|
||||||
for k in replacements:
|
|
||||||
nreplacements[k] = replacements[k].decode("UTF-8")
|
|
||||||
replacements = nreplacements
|
|
||||||
|
|
||||||
def pseudolocalize(string):
|
|
||||||
ret = ""
|
|
||||||
it = iter(string)
|
|
||||||
for ch in it:
|
|
||||||
if ch == '\\' or ch == '%':
|
|
||||||
ret += ch
|
|
||||||
ret += next(it)
|
|
||||||
continue
|
|
||||||
try:
|
|
||||||
if random.randint(0,2) == 0:
|
|
||||||
cand = replacements[ch]
|
|
||||||
ret += random.choice(cand)
|
|
||||||
else:
|
|
||||||
ret += ch
|
|
||||||
except KeyError:
|
|
||||||
ret += ch
|
|
||||||
return ret
|
|
||||||
|
|
||||||
def pseudolocalize_code(string):
|
|
||||||
if '"' not in string: return string
|
|
||||||
if '"null"' in string: return string
|
|
||||||
if '"Main Menu"' in string: return string # RetroArch bug, this string can't be translated.
|
|
||||||
|
|
||||||
parts = string.split('"')
|
|
||||||
parts[1] = pseudolocalize(parts[1])
|
|
||||||
return '"'.join(parts);
|
|
||||||
|
|
||||||
print("/* Autogenerated, do not edit. Your changes will be undone. */")
|
|
||||||
|
|
||||||
localize = True
|
|
||||||
for line in sys.stdin:
|
|
||||||
line = line.strip("\n")
|
|
||||||
|
|
||||||
if 'const char *hash_to_str_us_label_enum' in line: localize = False
|
|
||||||
if 'return "null"' in line: localize = True
|
|
||||||
if line=='#ifdef HAVE_PSEUDOLOCALIZE': line="#if 0"
|
|
||||||
|
|
||||||
if '#include' in line: pass
|
|
||||||
elif not localize: pass
|
|
||||||
else: line = pseudolocalize_code(line)
|
|
||||||
|
|
||||||
print(line)
|
|
Loading…
Reference in New Issue