Jump to content

Native language support in modinfo.lua (configuration_options)


Recommended Posts

Hello. Im trying to support russian language in options of my mod (configuration_options structure).

 

There is the Russian Language Pack (RLP) in Steam Workshop. And it contains various fonts etc.

 

It's ok if I use russian words in modinfo.lua when RLP is enabled. But if it is not enabled (or even not installed) then I see strange sybmols in options of my mod.

 

So I have 2 questions:

1) How to detect from modinfo.lua is there RLP enables or not?

2) How to detect from modinfo.lua what kind of OS user have (win, mac, linux etc)?

 

With these answer it is easy to solve the problem:

 

if LRP_is_enbaled and OS_win then
   configuration_options = { ......... }

elseif..........

 

P.S. Sorry about my english.

Link to comment
Share on other sites

Now I see: it's impossible...

local env = {}local fn = kleiloadlua("../mods/"..modname.."/modinfo.lua").......local status, r = RunInEnvironment(fn,env)

Empty environment is not so good idea...

 

It would be better if there was access to following data:

1) All names of mods

2) Status for each mod - is it previously enabled or not (before entering menu "Mod").

3) Version of the game

4) OS type

It might be just a copy. No need to change anything in global environment.

 

That's enough. Does it really will reduce speed of loading mods?

Link to comment
Share on other sites

Sorry for non english:

Этого никогда не будет, нет ни math ни strings. Все сделано с целью максимального упрощения modinfo.lua и видимо связанно с значительным увеличением времени загрузки, особенно в экране модов, если разрешить все.

вывод: делай две версии мода, если уж очень хочеться имет русский язык в опциях.

Link to comment
Share on other sites

Этого никогда не будет, нет ни math ни strings. Все сделано с целью максимального упрощения modinfo.lua и видимо связанно с значительным увеличением времени загрузки, особенно в экране модов, если разрешить все.

вывод: делай две версии мода, если уж очень хочеться имет русский язык в опциях.

 

В том-то и дело, что абсолютно ВСЁ не нужно. Нужно только определить, какие модификации работают, и на какой платформе запущен движок игры. Не так уж и много, правда?

Еще раз акцентирую внимание на том, что это нужно для нативной поддержки русского языка в настройках мода.

Link to comment
Share on other sites

Представь себе что каждый из 10-20 модов будет определять что работает, а что нет.

Потом еще проверять версию ОС и все что им заблагорассудиться. Modinfo не для этого.

Чтобы определить какие модификации работают - уже понадобиться strings.

Разработчик тут уже отвечал что специально не дают ничего для modinfo, чтобы максимально все упростить.

В чем проблема сделать две версии мода - одна полностью под русский язык и винду, вторая - все на английском.

И ничего не надо определять.

Link to comment
Share on other sites

Translated for those of us who are not Russian:

 

Sorry for non english:

That will never happen, no math or strings. Everything is done in order to maximize and simplify modinfo.lua apparently associated with a significant increase in load time, especially in the screen mods, if you allow it.

conclusion: do two versions of the mod, if you really really want to have the Russian language in the options.

 

 

That's the thing that absolutely EVERYTHING is not necessary. Only need to determine what modifications work, and on what platform game engine is running. Not so much, right?

Again focuses attention on the fact that it is necessary for native support for the Russian language in the mod.

 

 

Imagine that each of the 10-20 mods will determine what works and what does not.

Then again check the OS version and all that they want. Modinfo not for this.

To determine what modifications work - already need strings.

Developer here already posted that specifically do not give anything to modinfo, to simplify things as much as possible.

What is the problem to make two versions of the mod - one completely under Russian and Windows, the second - all in English.

And nothing should be defined.

And to add my own input, even if the mod screen could tell which mods are installed, it doesn't know if the mods are going to be enabled or disabled at that point. So a person could have the RLP installed but disabled, and your mod would give the option for Russian language incorrectly. It also doesn't know if a mod could crash when it's enabled or disabled. For this reason, on the mod screen, mods should be completely agnostic of each other.

If you only want to publish one version of the mod, my suggestion is: include the option for Russian language and add a note in the Klei/Steam download page to say, "if you want Russian support, you must also download the RLP mod" and include a link to the RLP mod. Chances are, Russian speakers will already have it. And if they don't, then they will appreciate you linking to it. =)

And a poor google translate to Russian:

И добавить свой собственный вход, даже если мод экран может сказать, какие установлены моды, он не знает, если моды собираетесь быть включена или отключена в этой точке. Таким образом, человек может быть установлен РЛП, но отключен, и ваш мод даст возможность для русского языка неправильно. Он также не знает, если мод может рухнуть, когда он включен или выключен. По этой причине на экране мод, моды должны быть полностью агностический друг от друга.

Если вы только хотите опубликовать одну версию мода, мое предложение включить опцию для русского языка, и добавить примечание в Клей / Паровая странице загрузки сказать, если вы хотите российскую поддержку, необходимо также скачать ПЛРС мод, и включают в себя ссылку на этот мод. Скорее всего, русскоязычные уже будет, что мод. И если они этого не делают, то они по достоинству оценят вашу рекламу его. =)

Sorry if that translation is bad. Google's fault!

Link to comment
Share on other sites

Very good point at disabling/enabling mods

and google translate is pretty bad here :(

My IMHO at all, i didn't look into game code about languages support, but there must be some global variable like GAMELANGUAGE='EN'

and in modinfo.lua

 

configuration_options ={.....}configuration_options_RU ={....}
and all other languages in this way

so mod's author doesn't require to think about external mods or about selected language

Link to comment
Share on other sites

All I need is the following fix of the game:

local env = {}env.GAMELANGUAGE = _G.GAMELANGUAGE --<<<<<<<<<.....local status, r = RunInEnvironment(fn,env)

So the task will be solved easy:

if (GAMELANGUAGE=='RU') then	configuration_options =	{	.....	}else	configuration_options =	{	....	}end

You even can to not create GAMELANGUAGE variable. Just let language mods to control it in global space. And throw it in local environment of modinfo.lua

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

Please be aware that the content of this thread may be outdated and no longer applicable.

×
  • Create New...