Process to translate PO files automatically for FREE using Google Translate, the script is written using JavaScript
- Node.js (10+)
-
Clone this repository
git clone [email protected]:naskio/po-auto-translation.git
-
Install dependencies
yarn install # or npm install
-
Convert your PO file into CSV using the following command
node index.js untranslated_XX.po > untranslated_XX.csv
-
Upload
untranslated_XX.csv
to Google Sheet -
Use the formula
=GOOGLETRANSLATE(A2;"en";"ar")
-
Convert the translated columns to text using
Copy the column then paste values only
-
Export file to CSV
translated_XX.csv
(download CSV) -
Convert the CSV file to PO file using the following command
node index.js untranslated_XX.po translated_XX.csv > translated_XX.po