Exemplo n.º 1
0
    public override void OnInspectorGUI()
    {
        TranslationConfigurationSO so = (TranslationConfigurationSO)target;

        DrawDefaultInspector();
        if (GUILayout.Button("Upload current set"))
        {
            var languageCodeList = new List <string> {
                so.sourceLanguage.code
            };
            so.destinationLanguages.ForEach((TransfluentLanguage lang) => { languageCodeList.Add(lang.code); });

            DownloadAllGameTranslations.uploadTranslationSet(languageCodeList, so.translation_set_group);
        }
        if (GUILayout.Button("Download known translations"))
        {
            if (EditorUtility.DisplayDialog("Downloading", "Downloading will overwrite any local changes to existing keys do you want to proceed?", "OK", "Cancel / Let me upload first"))
            {
                var languageCodeList = new List <string> {
                    so.sourceLanguage.code
                };
                so.destinationLanguages.ForEach((TransfluentLanguage lang) => { languageCodeList.Add(lang.code); });
                DownloadAllGameTranslations.downloadTranslationSetsFromLanguageCodeList(languageCodeList, so.translation_set_group);
            }
        }
    }
Exemplo n.º 2
0
    private void ShowUploadDownload()
    {
        var so = selectedConfig;

        GUILayout.Space(30);
        if (GUILayout.Button("Upload all local text"))
        {
            var languageCodeList = new List <string> {
                so.sourceLanguage.code
            };
            so.destinationLanguages.ForEach((TransfluentLanguage lang) => { languageCodeList.Add(lang.code); });

            DownloadAllGameTranslations.uploadTranslationSet(languageCodeList, so.translation_set_group);
        }
        if (GUILayout.Button("Download all translations"))
        {
            if (EditorUtility.DisplayDialog("Downloading", "Downloading will overwrite any local changes to existing keys do you want to proceed?", "OK", "Cancel / Let me upload first"))
            {
                var languageCodeList = new List <string> {
                    so.sourceLanguage.code
                };
                so.destinationLanguages.ForEach((TransfluentLanguage lang) => { languageCodeList.Add(lang.code); });
                DownloadAllGameTranslations.downloadTranslationSetsFromLanguageCodeList(languageCodeList, so.translation_set_group);
            }
        }
    }
Exemplo n.º 3
0
        public void TestFixBackwardsLanguage()
        {
            string jumbledThing = "hello }0{, how are you?";

            Debug.Log(DownloadAllGameTranslations.cleanBackwardsLanguageString(jumbledThing));
        }