xgettext-unity
v1.0.3
Published
Extract translation strings from Unity YAML files and generate POT files with them.
Downloads
3
Readme
xgettext-unity
About
Extract translation strings from Unity YAML files and generate POT files with them.
Usage
xgettextUnity(inputFiles, variables, outputFile);
inputFiles
: the list of Unity files to extractvariables
: which YAML variables to look for in the Unity filesoutputFile
: the output POT file (will be overwritten)
Example
Basic
var xgettextUnity = require("xgettext-unity").default;
var inputFiles = ["Assets/Scenes/SampleScene.unity", "Assets/Scenes/MainMenu.unity"];
var outputFile = "Assets/Localization/template.pot";
xgettextUnity(inputFiles, ["m_text"], outputFile);
With glob
var glob = require("glob");
var xgettextUnity = require("xgettext-unity").default;
var inputFiles = glob.sync("Assets/**/*.{unity,prefab}");
var outputFile = "Assets/Localization/template.pot";
xgettextUnity(inputFiles, ["m_text"], outputFile);
Authors
License
The program is licensed under the Apache License 2.0.
Building
npm install
npm run check
npm run build
npm run test