Exemplo n.º 1
0
    public static void ExportFile(string fileName)
    {
        // load original file
        string        fullFileName     = Localizer.FullFileName(fileName);
        LocalizerKeys localizationKeys = JsonReader.ReadJson <LocalizerKeys>(fullFileName);

        if (localizationKeys == default)
        {
            return;     // file failed to load
        }

        // collect keys
        int nKeys = localizationKeys.keys.Length;

        string[] keys = new string[nKeys];
        for (int i = 0; i < nKeys; ++i)
        {
            LocalizerValue localizerValue = localizationKeys.keys[i];
            keys[i] = localizerValue.key;
        }

        // export keys
        CreateKeysFile(fileName, keys);
    }