(nw) Improve localisation:

* Change makefile rules to treat mame.pot as a target so rules can depend on it
* Put mame.pot inside the build directory so it will get cleaned
* Couldn't get xgettext to scrape lua and C++ in the same command and still remove stale strings
* Use larger strings and format specifiers to fix some localisation issues
  - Issue with "None" lacking context in Russian and Turkish translations
  - Issue with "Not implemented" changing depending on the noun in Serbian
  - Issues with lua plugins not allowing for languages with different grammar/punctuation

Strings that need to be translated after this change - most of these are existing text that's been made into larger chunks or reworded slightly:

"Mechanical Machine\tYes\n"

"Mechanical Machine\tNo\n"

"Requires Artwork\tYes\n"

"Requires Artwork\tNo\n"

"Requires Clickable Artwork\tYes\n"

"Requires Clickable Artwork\tNo\n"

"Support Cocktail\tYes\n"

"Support Cocktail\tNo\n"

"Driver is BIOS\tYes\n"

"Driver is BIOS\tNo\n"

"Support Save\tYes\n"

"Support Save\tNo\n"

"Screen Orientation\tVertical\n"

"Screen Orientation\tHorizontal\n"

"Requires CHD\tYes\n"

"Requires CHD\tNo\n"

"ROM Audit Result\tOK\n"

"ROM Audit Result\tBAD\n"

"Samples Audit Result\tNone Needed\n"

"Samples Audit Result\tOK\n"

"Samples Audit Result\tBAD\n"

"ROM Audit Disabled\t\n"
"Samples Audit Disabled\t\n"

"Activated: %s = %s"

"Activated: %s"

"Enabled: %s"

"Disabled: %s"

"%s added"

"Default name is %s"

"Cheat written to %s and added to cheat.simple"

"Unable to write file\n"
"Ensure that cheatpath folder exists"
This commit is contained in:
Vas Crabb 2017-10-03 10:40:50 +11:00
parent 633c37236e
commit 2851d7d6cd
57 changed files with 72579 additions and 71475 deletions

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -971,9 +971,10 @@ PROJECTDIR := $(BUILDDIR)/projects/$(OSD)/$(FULLTARGET)
PROJECTDIR_SDL := $(BUILDDIR)/projects/sdl/$(FULLTARGET)
PROJECTDIR_WIN := $(BUILDDIR)/projects/windows/$(FULLTARGET)
.PHONY: all clean regenie generate
.PHONY: all clean regenie generate FORCE
all: $(GENIE) $(TARGETOS)$(ARCHITECTURE)
regenie:
FORCE:
#-------------------------------------------------
# gmake-mingw64-gcc
@ -1710,9 +1711,11 @@ shaders: bgfx-tools
.PHONY: translation
translation:
$(GENDIR)/mame.pot: FORCE
$(SILENT) echo Generating mame.pot
$(SILENT) find src plugins -iname "*.cpp" -print0 -o -iname "*.lua" -print0 | xargs -0 xgettext --from-code=UTF-8 -k_ -k__ -j -o mame.pot
$(SILENT) find language -iname "*.po" -print0 | xargs -0 -n 1 -I %% msgmerge -U -N %% mame.pot
$(SILENT) find language -iname "*.po" -print0 | xargs -0 -n 1 -I %% msgattrib --clear-fuzzy --empty %% -o %%
$(SILENT) find src -iname "*.cpp" -print0 | xargs -0 xgettext --from-code=UTF-8 -k_ -k__ -o $@
$(SILENT) find plugins -iname "*.lua" -print0 | xargs -0 xgettext --from-code=UTF-8 -k_ -k__ -j -o $@
translation: $(GENDIR)/mame.pot
$(SILENT) find language -name "*.po" -print0 | xargs -0 -n 1 -I %% msgmerge -U -N %% $<
$(SILENT) find language -name "*.po" -print0 | xargs -0 -n 1 -I %% msgattrib --clear-fuzzy --empty %% -o %%

View File

@ -650,7 +650,7 @@ function cheat.startplugin()
end
if event == "up" or event == "down" or event == "comment" then
if cheat.comment then
manager:machine():popmessage(_("Cheat Comment:\n") .. cheat.comment)
manager:machine():popmessage(string.format(_("Cheat Comment:\n%s"), cheat.comment))
end
elseif event == "left" then
if cheat.parameter then
@ -717,10 +717,10 @@ function cheat.startplugin()
else
subtext = cheat.parameter.value
end
manager:machine():popmessage(_("Activated") .. ": " .. cheat.desc .. " = " .. subtext)
manager:machine():popmessage(string.format(_("Activated: %s = %s"), cheat.desc, subtext))
elseif not cheat.parameter and cheat.script.on then
cheat.script.on()
manager:machine():popmessage(_("Activated") .. ": " .. cheat.desc)
manager:machine():popmessage(string.format(_("Activated: %s"), cheat.desc))
end
end
end
@ -778,16 +778,16 @@ function cheat.startplugin()
if not run_if(cheat, cheat.script.change) then
run_if(cheat, cheat.script.on)
end
manager:machine():popmessage(_("Activated") .. ": " .. cheat.desc)
manager:machine():popmessage(string.format(_("Activated: %s"), cheat.desc))
elseif not cheat.enabled then
cheat.enabled = true
run_if(cheat, cheat.script.on)
manager:machine():popmessage(_("Enabled") .. ": " .. cheat.desc)
manager:machine():popmessage(string.format(_("Enabled: %s"), cheat.desc))
else
cheat.enabled = false
run_if(cheat, cheat.script.off)
bwpclr(cheat)
manager:machine():popmessage(_("Disabled") .. ": " .. cheat.desc)
manager:machine():popmessage(string.format(_("Disabled: %s"), cheat.desc))
end
end
cheat.hotkeys.pressed = true
@ -846,7 +846,7 @@ function cheat.startplugin()
function ce.inject(newcheat)
cheats[#cheats + 1] = newcheat
parse_cheat(newcheat)
manager:machine():popmessage(newcheat.desc .. _(" added"))
manager:machine():popmessage(string.format(_("%s added"), newcheat.desc))
end
function ce.get(index)

View File

@ -351,7 +351,7 @@ function cheatfind.startplugin()
local r
name, r = incdec(event, name, 1, #c)
if (event == "select" or event == "comment") and name == 1 then
manager:machine():popmessage(_("Default name is ") .. cheat_save.name)
manager:machine():popmessage(string.format(_("Default name is %s"), cheat_save.name))
end
return r
end
@ -396,7 +396,7 @@ function cheatfind.startplugin()
file = io.open(cheat_save.path .. "/cheat.simple", "a")
file:write(string.format(cheat_save.simple, desc))
file:close()
manager:machine():popmessage(_("Cheat written to ") .. cheat_save.filename .. _(" and added to cheat.simple"))
manager:machine():popmessage(string.format(_("Cheat written to %s and added to cheat.simple"), cheat_save.filename))
end
written = true
elseif not devtable[devcur].space.shortname then
@ -409,7 +409,7 @@ function cheatfind.startplugin()
end
end
if not written then
manager:machine():popmessage(_("Unable to write file\nCheck cheatpath dir exists"))
manager:machine():popmessage(_("Unable to write file\nEnsure that cheatpath folder exists"))
end
cheat_save = nil
return true

View File

@ -942,22 +942,23 @@ void menu_select_game::general_info(const game_driver *driver, std::string &buff
else if (flags.imperfect_features() & device_t::feature::TIMING)
str << _("Timing\tImperfect\n");
util::stream_format(str, _("Mechanical Machine\t%1$s\n"), ((flags.machine_flags() & machine_flags::MECHANICAL) ? _("Yes") : _("No")));
util::stream_format(str, _("Requires Artwork\t%1$s\n"), ((flags.machine_flags() & machine_flags::REQUIRES_ARTWORK) ? _("Yes") : _("No")));
util::stream_format(str, _("Requires Clickable Artwork\t%1$s\n"), ((flags.machine_flags() & machine_flags::CLICKABLE_ARTWORK) ? _("Yes") : _("No")));
util::stream_format(str, _("Support Cocktail\t%1$s\n"), ((flags.machine_flags() & machine_flags::NO_COCKTAIL) ? _("Yes") : _("No")));
util::stream_format(str, _("Driver is BIOS\t%1$s\n"), ((flags.machine_flags() & machine_flags::IS_BIOS_ROOT) ? _("Yes") : _("No")));
util::stream_format(str, _("Support Save\t%1$s\n"), ((flags.machine_flags() & machine_flags::SUPPORTS_SAVE) ? _("Yes") : _("No")));
util::stream_format(str, _("Screen Orientation\t%1$s\n"), ((flags.machine_flags() & ORIENTATION_SWAP_XY) ? _("Vertical") : _("Horizontal")));
str << (flags.machine_flags() & machine_flags::MECHANICAL) ? _("Mechanical Machine\tYes\n") : _("Mechanical Machine\tNo\n");
str << (flags.machine_flags() & machine_flags::REQUIRES_ARTWORK) ? _("Requires Artwork\tYes\n") : _("Requires Artwork\tNo\n");
str << (flags.machine_flags() & machine_flags::CLICKABLE_ARTWORK) ? _("Requires Clickable Artwork\tYes\n") : _("Requires Clickable Artwork\tNo\n");
str << (flags.machine_flags() & machine_flags::NO_COCKTAIL) ? _("Support Cocktail\tYes\n") : _("Support Cocktail\tNo\n");
str << (flags.machine_flags() & machine_flags::IS_BIOS_ROOT) ? _("Driver is BIOS\tYes\n") : _("Driver is BIOS\tNo\n");
str << (flags.machine_flags() & machine_flags::SUPPORTS_SAVE) ? _("Support Save\tYes\n") : _("Support Save\tNo\n");
str << (flags.machine_flags() & ORIENTATION_SWAP_XY) ? _("Screen Orientation\tVertical\n") : _("Screen Orientation\tHorizontal\n");
bool found = false;
auto entries = rom_build_entries(driver->rom);
for (const rom_entry &rom : entries)
if (ROMENTRY_ISREGION(&rom) && ROMREGION_ISDISKDATA(&rom))
for (romload::region const &region : romload::entries(driver->rom).get_regions())
{
if (region.is_diskdata())
{
found = true;
break;
}
util::stream_format(str, _("Requires CHD\t%1$s\n"), found ? _("Yes") : _("No"));
}
str << found ? _("Requires CHD\tYes\n") : _("Requires CHD\tNo\n");
// audit the game first to see if we're going to work
if (ui().options().info_audit())
@ -970,19 +971,21 @@ void menu_select_game::general_info(const game_driver *driver, std::string &buff
// if everything looks good, schedule the new driver
if (summary == media_auditor::CORRECT || summary == media_auditor::BEST_AVAILABLE || summary == media_auditor::NONE_NEEDED)
str << _("Roms Audit Pass\tOK\n");
str << _("ROM Audit Result\tOK\n");
else
str << _("Roms Audit Pass\tBAD\n");
str << _("ROM Audit Result\tBAD\n");
if (summary_samples == media_auditor::NONE_NEEDED)
str << _("Samples Audit Pass\tNone Needed\n");
str << _("Samples Audit Result\tNone Needed\n");
else if (summary_samples == media_auditor::CORRECT || summary_samples == media_auditor::BEST_AVAILABLE)
str << _("Samples Audit Pass\tOK\n");
str << _("Samples Audit Result\tOK\n");
else
str << _("Samples Audit Pass\tBAD\n");
str << _("Samples Audit Result\tBAD\n");
}
else
str << _("Roms Audit Pass\tDisabled\nSamples Audit Pass\tDisabled\n");
{
str << _("ROM Audit Disabled\t\nSamples Audit Disabled\t\n");
}
buffer = str.str();
}

View File

@ -334,25 +334,21 @@ void simple_menu_select_game::custom_render(void *selectedref, float top, float
tempbuf[3] = _("Overall: Working");
// next line is graphics, sound status
const char *gfxstat;
if (m_cached_unemulated & device_t::feature::GRAPHICS)
gfxstat = _("Unimplemented");
tempbuf[4] = _("Graphics: Unimplemented, ");
else if ((m_cached_unemulated | m_cached_imperfect) & (device_t::feature::GRAPHICS | device_t::feature::PALETTE))
gfxstat = _("Imperfect");
tempbuf[4] = _("Graphics: Imperfect, ");
else
gfxstat = _("OK");
tempbuf[4] = _("Graphics: OK, ");
const char *soundstat;
if (m_cached_flags & machine_flags::NO_SOUND_HW)
soundstat = _("None");
tempbuf[4].append(_("Sound: None"));
else if (m_cached_unemulated & device_t::feature::SOUND)
soundstat = _("Unimplemented");
tempbuf[4].append(_("Sound: Unimplemented"));
else if (m_cached_imperfect & device_t::feature::SOUND)
soundstat = _("Imperfect");
tempbuf[4].append(_("Sound: Imperfect"));
else
soundstat = _("OK");
tempbuf[4] = string_format(_("Gfx: %s, Sound: %s"), gfxstat, soundstat);
tempbuf[4].append(_("Sound: OK"));
}
else
{