Closed DisasterMo closed 2 years ago
This pull request introduces 1 alert when merging bd133bc7b465a4a8e9cb344e676b249482891fd6 into 2127f25d9b4970371d7b312e74cc9e64f13e6f7c - view on LGTM.com
new alerts:
Okay, new approach! This one sets up 2 GitHub actions designed to
libretro_core_options.h
every time that file is changedlibretro_core_options_intl.h
every time something within libgambatte/libretro/intl/
is changedThe purpose of this is to enable periodic source/translations sync via Crowdin's GitHub integration option. Once this integration is set up, the process will run almost entirely automatically:
libretro_core_options.h
will also result in the first action creating/updating the repo's source text .jsonintl
folder, so the second GitHub action kicks in, reconstructing libretro_core_options_intl.h
on the basis of these new translation files
The Problem
The current state of core options is very translation unfriendly - the only way to add translations is by copying the entire
option_defs_us
array from libretro_core_options.h to libretro_core_options_intl.h and add each translation into place manually.There exists no easy way to upload the texts to crowdin and updating the translations is just a pain.
Suggested Solution
In this PR I attempt to rectify this, even though a little naively: by converting the handling of core options into a form similar to how it is done in RetroArch - by utilising hash keys to fetch the actual string via the
msg_hash_to_str()
function from a msg_hash file corresponding to the current user language. Scripts for converting such msg_hash files into jsons for uploading to crowdin already exist and would need to be modified only slightly for compatibility with core options.This here is a proof of concept for that idea and my scripts from libretro/RetroArch#12772.
Reviewers
@jdgleaver, since they just finished up the v2 update (thank you for your hard work!).