Currently, I am facing a challenge with a large file that needs translation for the WordPress LocoTranslate plugin. Specifically, I need to translate the content within the msgstr
quotes based on the content in the msgid
quotes. An example of this is:
#: ../../app/Models/SettingsAPI.php:105,
#: ../../app/Controllers/Settings/AdminSettings.php:354
msgid "Your settings have been saved."
msgstr "Tus opciones fueron guardadas."
#: ../../app/Models/SettingsAPI.php:695,
#: ../../app/Controllers/Admin/Meta/AddTermMetaField.php:357,
#: ../../app/Controllers/Admin/Meta/AddTermMetaField.php:469
msgid "Add Image"
msgstr "Agregar Imagen"
I attempted using Google Sheets and the Google Translate API, but found them to be unreliable. As a workaround, I considered manually transposing the string like so:
#: ../../app/Models/SettingsAPI.php:105,
#: ../../app/Controllers/Settings/AdminSettings.php:354
msgid "Your settings have been saved."
msgstr "Your settings have been saved."
My initial thought was to utilize a text editor like Notepad++ along with a regular expression msgid \"(.*)\"
, but I encountered difficulties replacing the subsequent line (msgstr.*
) entirely.
Prior to developing the tool aimed at aiding in this translation process, I struggled with harnessing the full potential of Notepad++. Unfortunately, the tool did not meet my expectations in terms of functionality.
Any recommendations or guidance would be greatly appreciated.