ffxivapp icon indicating copy to clipboard operation
ffxivapp copied to clipboard

Help translate the app.

Open Yaguar666 opened this issue 9 years ago • 32 comments

Hi Ryan! I need your help. I try to translate into Russian FFXIVAPP. Already translated and added similar components in the file: 2015-06-01_112145

Created and filled file Russian.cs

Translated and recompile: FFXIVAPP.Localization.dll FFXIVAPP.Common.dll FFXIVAPP.IPluginInterface.dll

I recompile FFXIVAPP, but can be seen only after the launch icon and explanation when it leads to the mouse cursor. Pressing the language is changed to English. All other languages ​​work.

More plug-ins are no longer installed.

Just a test plug in unmodified FFXIVAPP, after installation and restart APP, remains in the "unidentified".

Is there any function to APP writing error, etc. a file? And it would be desirable to understand)

Yaguar666 avatar Jun 01 '15 09:06 Yaguar666

And what are it doing:

catch (Exception ex) ?

Yaguar666 avatar Jun 01 '15 10:06 Yaguar666

When it comes to localization the application used to have two separate settings.

  • UI Language
  • Game Language

It was at the time however; confusing for users because they would set the UI language and not set the Game Language. They would assume the program did not work.

I consolidated those two and the way it works now is when you click the Icon for the language at the top, it will set the game language to the same thing.

In this case the default work flow is that if you added a Russian flag to the top, and then click it. It would try and set the game language to Russian (which of course is not available at this time).

Each plugin also exposes a list of supported languages as well. As an example found here:

https://github.com/cjmanca/FFXIVDBM.Plugin/blob/master/FFXIVDBM.Plugin/Constants.cs#L46

It's used by code like this:

https://github.com/Icehunter/ffxivapp-plugin-parse/blob/master/FFXIVAPP.Plugin.Parse/Helpers/LocaleHelper.cs#L48

If the language isn't supported it will default to English.

With the new plugin changes I did I also don't use that localization library anymore and they are all now contained in named locale files inside the plugin.

The catch right now is just for catching errors but it can be logged use the NLog viewer.

Setup can be found here: http://ffxiv-app.com/topic/22/about-ffxivapp/3

Icehunter avatar Jun 01 '15 18:06 Icehunter

Yeah. Hmm, and yet possible to make only the language of UI has changed, and the language of the game remained, say, English? Where can I edit the code?

Change, for example, Settings.Default.GameLanguage = "en" and UILanguage = "ru"?

Yaguar666 avatar Jun 01 '15 19:06 Yaguar666

It's not quite as simple as that; because for the UI to update it's tied to GameLanguage.

Let me see if there's something more I can do in the main app to allow this and make it work appropriately. Such as choosing a non-game language can request a UI update but default to a game language of English.

Icehunter avatar Jun 01 '15 22:06 Icehunter

Hello again. It turned out to change something?

Yaguar666 avatar Jun 05 '15 12:06 Yaguar666

I found an annoying bug in the code in App.cs that prevented the localization of applications. I forgot to add "ru":

                case "GameLanguage":
                    Constants.GameLanguage = Settings.Default.GameLanguage;
                    var lang = Settings.Default.GameLanguage.ToLower();
                    var cultureInfo = new CultureInfo("en");
                    switch (lang)
                    {
                        case "french":
                            cultureInfo = new CultureInfo("fr");
                            break;
                        case "japanese":
                            cultureInfo = new CultureInfo("ja");
                            break;
                        case "german":
                            cultureInfo = new CultureInfo("de");
                            break;
                        case "chinese":
                            cultureInfo = new CultureInfo("zh");
                            break;
                        case "russian":
                            cultureInfo = new CultureInfo("ru");
                            break;
                    }

Now the application is localized (the part that works with a dictionary). But the plugins is "Out of date" and not working. Although I rebuilt with new plugin dll. Maybe it depends on the version?

Yaguar666 avatar Jun 05 '15 14:06 Yaguar666

Ah, version check was added at 3.0.5592.26103 build, ok, will try to make it work)

Yaguar666 avatar Jun 05 '15 14:06 Yaguar666

Is it possible to make the plugin version that is higher than the version on the server, and also passed the validation work?

Yaguar666 avatar Jun 05 '15 15:06 Yaguar666

As long as the versions of the following libraries in the plugin are not lower than what is included in the app any plugin should load.

https://github.com/Icehunter/ffxivapp/blob/master/FFXIVAPP.Client/PluginHost.cs#L91

Regarding the UI and language updates. I'll be committing code tonight that changes the language buttons at the top to a drop down. Adding a new language is pretty simple and if you want a language different than the game language that will be allowed.

I'll have more details later after I commit.

Icehunter avatar Jun 05 '15 16:06 Icehunter

Version of libraries are simple, but: 2015-06-05_193625 2015-06-05_193644 Try to up version of Widgets.

Yaguar666 avatar Jun 05 '15 16:06 Yaguar666

If you recompiled any of those dependencies yourself they won't match the ones I released and prevent loading. if you go back to using the versions I have in the resource repo and from the released version of ffxivapp it should be fine.

Icehunter avatar Jun 05 '15 16:06 Icehunter

I added a crutch to check the translation plugins) 2 hours - normal flight:

    private bool HostAssemblyValidation(string name, Version version)
    {
        var reference = Assembly.GetExecutingAssembly()
                                .GetReferencedAssemblies()
                                .FirstOrDefault(a => a.Name == name);
        if (reference == null)
        {
            return true;
        }
        return true;

// return version.CompareTo(reference.Version) == 0; }

Yaguar666 avatar Jun 05 '15 18:06 Yaguar666

You can change that locally if you like; but in the event something is upgrade like MahApps.Metro and the other plugins haven't updated it's going to cause the app to crash, behave badly or just show a white screen.

Icehunter avatar Jun 05 '15 19:06 Icehunter

Yeap, it's only for test)

Yaguar666 avatar Jun 05 '15 20:06 Yaguar666

And what is responsible for setting the name of the plug-in, the name of the tab? 2015-06-06_171445

Yaguar666 avatar Jun 06 '15 14:06 Yaguar666

https://github.com/Icehunter/ffxivapp-plugin-parse/blob/master/FFXIVAPP.Plugin.Parse/Plugin.cs#L135

:)

Icehunter avatar Jun 06 '15 14:06 Icehunter

So far it doesn't support translation at this time however. I'm looking at a way to put that in.

Icehunter avatar Jun 06 '15 14:06 Icehunter

Tx)))) Very quick answer))) It's hard to understand someone else's code) Slowly I understand)

Ok, it would be nice.

Yaguar666 avatar Jun 06 '15 14:06 Yaguar666

Updated the main app now to support separation of game/ui updates. So you can choose another language for the UI and have a different one for the game. Message boxes will advise on updates.

Icehunter avatar Jun 07 '15 03:06 Icehunter

Cool! ^_^ And how to from the Dictionary, depending on the language, cause the variable? For example event_RegExLabel?

Where to download the changed files that you added to your repository? 95% is already translated. ^_^

Yaguar666 avatar Jun 07 '15 13:06 Yaguar666

Here's how you add your own language:

  • Save a ru.png flag file in resources.
  • Add a language info item into the bootstrapper here: https://github.com/Icehunter/ffxivapp/blob/master/FFXIVAPP.Client/AppBootstrapper.cs#L143
  • Add a Russian.cs file inside Localization/Russian.cs in the main app and any plugin you make.
  • In your plugin make sure you add a supported langage of "ru" inside the Constants.cs file. Example here: https://github.com/Icehunter/ffxivapp-plugin-parse/blob/master/FFXIVAPP.Plugin.Parse/Constants.cs#L46

Which reminds me... I have to add Chinese into the parser as supported lol I thought I did that already.

Icehunter avatar Jun 07 '15 15:06 Icehunter

I was add translation in files, added translation to the libraries. I wanted to help you, and add to the possibility of translate of the objects that you have not realized. How to add to XAML files - I understood by analogy it is easy to do. But what to do with calling a variable from the dictionary for C # ... For is simply one language, but for a few I have not thought of)

Yaguar666 avatar Jun 07 '15 15:06 Yaguar666

If you're dealing with the main application you only need to reference something like this:

https://github.com/Icehunter/ffxivapp/blob/master/FFXIVAPP.Client/Views/SettingsView.xaml#L29

AppProperties is imported globally for all xaml files.

However if it's a plugin make sure to add the following line at the top:

https://github.com/Icehunter/ffxivapp-plugin-parse/blob/master/FFXIVAPP.Plugin.Parse/Views/SettingsView.xaml#L11

Then you import the PluginViewModel like so:

https://github.com/Icehunter/ffxivapp-plugin-parse/blob/master/FFXIVAPP.Plugin.Parse/Views/SettingsView.xaml#L19

After that you can use it like this:

https://github.com/Icehunter/ffxivapp-plugin-parse/blob/master/FFXIVAPP.Plugin.Parse/Views/SettingsView.xaml#L29

Icehunter avatar Jun 08 '15 04:06 Icehunter

That's all I had to do:

https://drive.google.com/file/d/0BweYJ0oqWXvyamNIVXFBR1Jjc1E/view?usp=sharing

Somewhere there really is an error in translation, but it is fixable) And yet somehow plugins is "Out of Date".

Yaguar666 avatar Jun 08 '15 07:06 Yaguar666

Did you build own copies of any of these?

        "FFXIVAPP.Common",
        "FFXIVAPP.IPluginInterface",
        "MahApps.Metro",
        "HtmlAgilityPack",
        "NAudio",
        "Newtonsoft.Json",
        "NLog",
        "System.Windows.Interactivity"

If you did then you also have to compile the plugin with those versions. It's recommended that unless you have changes specific to something in those libraries you use the ones that came in the resources project or with the main app itself.

Icehunter avatar Jun 08 '15 16:06 Icehunter

I changed only that main lib: "FFXIVAPP.Common", "FFXIVAPP.IPluginInterface" "FFXIVAPP.Localization" Yeap, i used changed versions for main app & plugins from the same source, but something don't work.

_<

Yaguar666 avatar Jun 08 '15 16:06 Yaguar666

Is your code pushed somewhere where I can see it; like github. I can pull the code and try to build it myself.

Icehunter avatar Jun 08 '15 16:06 Icehunter

https://github.com/Yaguar666?tab=repositories Load all to github

Yaguar666 avatar Jun 08 '15 19:06 Yaguar666

Because you didn't fork them from github it was a little difficult to see some differences but one big difference is that the version of common.dll you use is much newer than that one I use, because of that no plugin will load until it's also compiled with that same version.

What changes did you make to common?

Icehunter avatar Jun 08 '15 20:06 Icehunter

Reloaded. At first I loaded your files, and then changed over me now all changes at a glance)

https://github.com/Yaguar666?tab=repositories

I should not have got into the Common.dll? I just changed Localization.dll and recompile everything with which it is associated.

I recompile all over again, from Localization to plugins and plugins have earned)

Yaguar666 avatar Jun 09 '15 10:06 Yaguar666