Closed wookiefriseur closed 5 years ago
Thank you for your attention, is very good to know that people are wanting to help. :)
You have good points, but I have to disagree about other points. About the keys and all translation in one file: It is easier to load in the application, it is easier to control if any file is missing, it is easy to work with the code, it is easy to see the text in the code. For example if you check the "HERE: Questions, suggestion and issues" topic, you will see that some people simply forgot to put some files that are in the zip. To stop these problems I had to put a check for each file in order to avoid user errors, so controlling a whole folder is more code to worry about. And some people just do not like to put so many files in the server folder. Only 3 files is ok, it's easy to uninstall. About the file size, believe me, it does not make any difference to the computer, we're talking about KB. For the translator I do not think it's harder or bigger, I've worked on translating more than 20 apps/games into my native language, by far the majority of them had a localization system much harder to work than that. In the end it all boils down to how easy it is to work with the location system, how fast to program it is. And remember, the tool so far is maintained by one man, it's a lot of thing to worry about.
If you look for others, the much-used location system is exactly how it works. https://en.wikipedia.org/wiki/Gettext in wordpress for example is the same.
Like to implement something in the current way, you just need write some text calling _p() function, and it's all. Missing translations go to translation file after finish the code.
I agree that we have to improve the translation system, but in other things:
Also, if you look at community comments, the demand is much higher in novices by tutorials, manual, faq, new functions.
In some other points you are right, but it is a characteristic of the form of localization in general. Each type has its pros and cons, in my assessment this fits best by development time. But the tool is open source, you can modify it, as I said I just thing is not the point of spending too much work now.
I appreciate the attention you're taking with this project!, thanks!
Oh, didn't expect an answer so fast.
And some people just do not like to put so many files in the server folder. Only 3 files is ok, it's easy to uninstall.
I prefer to put programs into their own folders instead of server files because if you have multiple tools and scripts in the end you will not know what belongs to the server and what is external. I put your tool in a different folder and I am glad that it is possible (except for the steamcmd folder, I will try to write a change so that you can use a custom existing steamcmd folder). I can see where you're coming from when the tool is in the server folder though: Steamcmd, steamapps, and language folder would start to look like too much and nobody would know which file to delete when uninstalling. I won't do any changes here (except for the custom steamcmd location).
It's easy to understand what the text is saying, you do not have to search for the meaning of a key. It's easy to implement in code, you just need to write the text by calling the toollanguage and the structure will look for a translation or mark it as required translation.
Mouse over on constants shows the text and good constant names would let the programmer know what the string is used for. For user made translations they would copy the English or another language file and would see the meaning in the value instead of the key. A comment for the users could be added above each section for more clarity. I'm not saying your system is bad, quite the opposite, it's a cool idea, just thinking about improvements.
It is easier to load in the application, it is easier to control if any file is missing, it is easy to work with the code, it is easy to see the text in the code.
For me it's harder because I'm unfamiliar with the code, so for me there are multiple points of failure (whole text to fuck up 😁) instead of just 1 autocompleted constant name. But that's just what I prefer. In the end it's more important what is easier and faster for you because you are the author and maintainer. So I won't do any changes that would force you to change your workflow.
As long as there are not that many strings and not that many languages no major changes are needed. As I said, it's low priority.
And even if there are more languages and strings in the future, your proposed changes are a good fix:
Maybe place missing localization keys for each language in the primary location file. Find text in code that is not being translated and implement the call function. Remove duplicate or unused translations. Improve the header explanation of how to translate
I will try to implement some of your points when I have time (I'll put them in the checklist in the first post).
Just to add some context why I came up with these changes at all: 8fff85cfed6e04d5f7e154d86ffbfe22c7eef1ad
I fixed some typos (values only) and was thinking about changing the keys in the translation and in the code while it's not too much to change. I also noticed some keys having :
or spaces
that were missing in the values. I don't know if spaces
are trimmed so I added them just to be sure.
Hey, there 👋
The translation system is working fine but while translating I noticed, that it is probably hard to maintain the code and keep the translations up to date. There are some texts that are not translated and some are translated twice and so on. As it is not a bug or anything it's low priority.
I have some ideas for improvements but I'm not sure yet what would be the best way. Just posting this issue so that we can discuss it or at least have some kind of documentation for later reference. If I have time and it's OK i will try to implement the discussed changes and do a pull request (I need some practice 😉).
Current state
Structure
Pros:
#Comments
which is niceKF2ServerTool.lc
Cons:
KF2ServerTool.lc
KF2ServerTool_MissingLocalization.txt
is unnecessary debug for the user I thinkCode
Pros:
["$LANGNAME{-$LANGDIALECT}", "$LANGCODE"]
"$KEY"="{$VALUE}"
KF2ServerTool.lc
Cons:
KF2ServerTool.lc
\n
)Thoughts
Structure and Code
lang
)KF2ServerTool.lc
into a separate readme filePortuguês_PT-BR.lc
)English_EN-GB.lc
and rename their new file\n
from the values and do it dynamically so the user doesn't have to"This will erase the workshop data base file.\nAre you sure?"="This will erase the workshop data base file.\nAre you sure?"
[MAIN]
DLG_CLEAN_WORKSHOP_DATA="This will erase the workshop data base file.\nAre you sure?"
Are you sure?
is used ~4 times as part of longer texts and could have its own kv-pair likeGENERAL_QUESTIONS_CONFIRM="Are you sure?"
toolLanguage.pas
or have its own constants classEnglish_EN-GB.lc
) from the constants (including sections, kv-pairs and comments)English_EN-GB.lc
(and a simple diff lets you change the other language files within minutes; could be automated later)ToDo (last edit: 2019-06-10)