Skip to content

Extract translation strings from Unity YAML files and generate POT files with them.

License

Notifications You must be signed in to change notification settings

Spark-NF/xgettext-unity

Repository files navigation

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

About

Extract translation strings from Unity YAML files and generate POT files with them.

Resources

License

Stars

Watchers

Forks

Packages

No packages published