This is Google Apps Script for translating PHPMaker language file from english.en-US.xml
to another languages.
- This Apps Script need access to Standard GCP Project. Create Standard GCP Project here.
- Enable "Google Drive API" and "Google Picker API" for the project.
- Generate API Key.
- Copy GCP Project Number to Apps Script -> Project Settings -> Google Cloud Platform (GCP) Project.
- Store API Key and GCP Project Number in Script Properties. Add key-value pair
{ "apiKey": API Key, "projectNumber": GCP Project Number }
to Apps Script -> Project Settings -> Script Properties.
- Upload current
english.en-US.xml
file used by PHPMaker to Google Drive. - Upload your previous translation file to Google Drive.
- Menu toolbar: XML -> Get XMLs, to parse the XMLs to Google Sheets. Input your language in ISO-639 code. Please be aware that Google Cloud Translation use ISO-639 while PHPMaker use RFC 4646.
- Newly introduced phrases will be auto-translated and highlighted in column C.
- Old phrases will not be translated. Please recheck because sometimes PHPMaker change the value of old phrases.
- DO NOT translate
%s, %d, %d%%, %n$d of %n$d, {n} and $n
(where n is digit). - Menu toolbar: XML -> Create new XML, to generate new translation file.