While working on that:
https://github.com/elkarte/Elkarte/pull/2965/files
I started thinking that maybe move the agreement to the language dir and make it some more consistent with the rest of the internationalized stuff (like agreement.english.txt instead of agreement.txt for example) would be a nice thing to do.
What do you think?
Makes a lot of sense to me!
Actually, while re-reading my post, I got another strange idea.
Provided this (even moving the agreement) is to me a 2.0 line of thoughts, I was wondering as well: hmm... in the past it made sense to have language files in php because we were using globals and variables inside strings, etc. But today is more just to have the array handy.
Then why don't we try with JSON or YAML files and a kind of "cache".
I mean: the language files in JSON or YAML, then a kind of "task" that reads the text files and converts them into php files stored in the cache directory (that should become mandatory).
The advantage would be that the integrated language editor would become much easier (no need for fancy tricks to try to avoid php injections) and, if the format is YAML, it should also become easier to direct editing the files (I think).
Of course there is the drawback of having to deal with the "read-text-and-convert-to-php" thing, and the keep it up to date, but being necessary only a once in a while, it shouldn't be that difficult (I hope).
Dunno, random thoughts. lol
The move is tacked https://github.com/elkarte/Elkarte/issues/2968
A question that has concerned me about the language files for a long time: Why are these files in the folder "themes/language" and not somewhere in the "sources"?
Because in theory, themes could add their own strings.
TBH I'm not sure what structure I would like to see in the "far future", so I'm not sure where to move them (well, if I may dream, one day I would like to see all the files related to a certain feature all in one place, but I guess this is easier said than done).
As we would say in German: That's a reason, but not an obstacle! ;)
Well, I've already seen forks, which in my opinion had a much better structured folder and file layout. 8)
I think also about this ... and I prefer the structure
/Sources
/Themes
/Languages
and in the language folder Subfolder for any language ..
I agree. And if there will be a theme with different language files, it should be
../languages/theme_name/language (f.o. english)/file
It should not be:
../themes/theme_name/languages/language (f.o. english)/file
Because no translator will look into a theme folder to translate language files.
So: Yes, the agreement should be part of the language files! ;)
Yup. Kinda nice if language has its own root folder. Easier to maintain and may be, minimize in the future since there is too much redundancies.
It is not, actually is themes\
default\languages\english and themes\default\languages\Italian ... Etc
Anyway it has more sense to be outside the themes folder, but once you know where they are it's not a big deal... Imho
They can be n any theme according to the code, but most themes choose not to add their own files. Fr example, that is why some themes may have ThemeStrings.english.php.
Didn't know, there is always something new to discover. Thanks for the information.