LoTROInterface

LoTROInterface (https://www.lotrointerface.com/forums/index.php)
-   Released Interfaces (L) (https://www.lotrointerface.com/forums/forumdisplay.php?f=12)
-   -   Lotro Chann Filter EN Translate (https://www.lotrointerface.com/forums/showthread.php?t=3696)

Ledviper 05-20-2018 02:20 PM

The plugin is multilingual at this point, even when it was only in french it still worked on the English client. The lines you mentioned are to do with the list of chat channels the plugin uses, line 22 references a previously loaded script(Language.lua) and that's where the translations are.

If it's saying 'tradcanal' is a nil value(trad being french shorthand for translation, canal being channel) that makes me think you aren't actually running the English locale, or the French or German ones for that matter, and indeed I was able to reproduce the error by manually setting the locale to something other than "en" "fr" or "de". You can check and change which locale you are using near the top right of the launcher, but as far as I know the client only supports the same languages as the plugin. *shrugs*


Potential Solution(s)
*It would be best to make the changes while the game is closed though not necessary. You can unload your plugins, make the change, refresh plugins, and then load them again.*

open up the Language.lua file the first line should be:
Code:

L=Turbine.Engine:GetLocale();
if it is not, change it to that and that should fix it.

If the line does match however a not-so-elegant solution should be to change it to this:
Code:

L="en";

marmi 05-20-2018 03:17 PM

Thanks for help!
My language.lua 1st line was indeed like you posted. I changed it to "en"; and it worked!
GetLocale() returns my OS language isn't it? It's other than en, de or fr just like for many other players. I checked my other plugins and they don't use language.lua or at least not that function. That makes me think this plugin may not load in such cases, but it's hard to believe no one with with other than en/de/fr OS tried this plugin so far...
Or maybe I misunderstood something, English is not my native either and in French I know only je taime :cool:

Ledviper 05-20-2018 04:58 PM

You're actually right, it returns the OS locale. I'm not a plugin author just good at figuring stuff out. I'm pretty sure I know a more proper fix for this and I'll pass it along to the author.

many plugins have localization, but all the .lua files are made by the authors, It's up to them how they organize and implement such things.

glafria 05-21-2018 04:27 AM

I think the error occours of a little mistake


this should work

Code:

L=Turbine.Engine.GetLocale();

At line 1 in the language.lua is used an : before GetLocale

Ledviper 05-21-2018 09:25 AM

any reference to Turbine.Engine.GetLocale() I've found says it returns the OS locale, admittedly most posts are pretty old so maybe it changed idk.

http://www.lotrointerface.com/downlo...=oldest&page=7

https://www.lotro.com/en/forums/show...ine.GetLocale()

http://www.lotrointerface.com/wiki/GetLocale

the first link indicates Turbine.Engine.GetLanguage() should be used, and ya, the colon seems like a typo, again i'm not uh fluent in lua, but it did seem to still work.

glafria 05-21-2018 09:36 AM

In the language.lua you found this
Code:


L=Turbine.Engine:GetLocale();

and not the correct syntax
Code:


L=Turbine.Engine.GetLocale();


Ledviper 05-21-2018 12:09 PM

Quote:

Originally Posted by glafria (Post 12111)
In the language.lua you found this
Code:


L=Turbine.Engine:GetLocale();

and not the correct syntax
Code:


L=Turbine.Engine.GetLocale();


both forms work.
I used Locale Emulator to run lotro with Japanese locale and received the same error with both forms.

replacing that line with the following is how it should be, I've tested it with Japanese locale, still downloading French and German languages to test those:
Code:

L = Turbine.Engine:GetLanguage();
if L == 0 or L == 2 or L == 268435457 then L = "en";
elseif L == 268435459 then L = "fr";
elseif L == 268435460 then L = "de";
elseif L == 268435463 then L = "ru"; end

Code is from Pulse's comment

Thurallor 05-21-2018 02:02 PM

Code:

Turbine.Engine.GetLocale();
Turbine.Engine:GetLocale();

Since the function takes no arguments, the two are effectively the same. In the second case, Turbine.Engine is implicitly passed as the first argument. So, the following two are exactly equivalent:

Code:

Turbine.Engine:GetLocale();
Turbine.Engine.GetLocale(Turbine.Engine);

There is a corresponding shorthand that can be used when defining functions. From the Lua 5.1 manual:

Quote:

The colon syntax is used for defining methods, that is, functions that have an implicit extra parameter self. Thus, the statement
function t.a.b.c:f (params) body end
is syntactic sugar for
function t.a.b.c.f (self, params) body end


Galphoglas 05-21-2018 02:32 PM

1.3.0
 
Hello!


Whaou! I like this! I don't think so much hype for my plugin


Relaxe! The 1.3.0 Version be there soon. Whith Galphoglas folder and patch for get local ^^

Ho! and I added an import/export function


Sorry for my english!

glafria 05-21-2018 03:39 PM

Thank you.


And thank for explaning thurallor.


All times are GMT -5. The time now is 06:17 AM.

vBulletin® - Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© MMOUI