Skip to content

Latest commit

 

History

History
executable file
·
52 lines (41 loc) · 1.7 KB

README.md

File metadata and controls

executable file
·
52 lines (41 loc) · 1.7 KB

xgettext-unity

NPM version Build Status Code Coverage Project license

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 extract
  • variables: which YAML variables to look for in the Unity files
  • outputFile: 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