ElkArte Community

Elk Development => Feature Discussion => Topic started by: emanuele on August 06, 2017, 01:07:38 pm

Title: Move agreement to the language dir?
Post by: emanuele on August 06, 2017, 01:07:38 pm
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?
Title: Re: Move agreement to the language dir?
Post by: Spuds on August 06, 2017, 03:28:28 pm
Makes a lot of sense to me!
Title: Re: Move agreement to the language dir?
Post by: emanuele on August 06, 2017, 05:20:56 pm
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
Title: Re: Move agreement to the language dir?
Post by: ahrasis on August 06, 2017, 09:11:58 pm
Same with me.
Title: Re: Move agreement to the language dir?
Post by: emanuele on August 07, 2017, 02:47:58 am
The move is tacked https://github.com/elkarte/Elkarte/issues/2968
Title: Re: Move agreement to the language dir?
Post by: McFly on August 09, 2017, 06:13:22 am
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"?
Title: Re: Move agreement to the language dir?
Post by: emanuele on August 09, 2017, 07:26:05 am
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).
Title: Re: Move agreement to the language dir?
Post by: McFly on August 10, 2017, 03:21:40 am
Quote from: emanuele – Because in theory, themes could add their own strings.
...
As we would say in German: That's a reason, but not an obstacle!  ;)

Quote from: emanuele – ...
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).
Well, I've already seen forks, which in my opinion had a much better structured folder and file layout.  8)
Title: Re: Move agreement to the language dir?
Post by: Feline on August 10, 2017, 06:57:45 am
I think also about this ... and I prefer the structure
/Sources
/Themes
/Languages
and in the language folder Subfolder for any language ..
Title: Re: Move agreement to the language dir?
Post by: Jorin on August 10, 2017, 07:06:46 am
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!  ;)
Title: Re: Move agreement to the language dir?
Post by: ahrasis on August 11, 2017, 11:14:06 am
Quote from: Feline – I think also about this ... and I prefer the structure
/Sources
/Themes
/Languages
and in the language folder Subfolder for any language ..

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.
Title: Re: Move agreement to the language dir?
Post by: radu81 on August 11, 2017, 05:59:26 pm
Quote from: Jorin – It should not be
../themes/theme_name/languages/language (f.o. english)/file
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
Title: Re: Move agreement to the language dir?
Post by: live627 on August 11, 2017, 07:45:41 pm
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.
Title: Re: Move agreement to the language dir?
Post by: Jorin on August 14, 2017, 12:51:58 am
Quote from: radu81 – It is not, actually is themes\default\languages\english and themes\default\languages\Italian  ... Etc

I know.  ;)
Title: Re: Move agreement to the language dir?
Post by: radu81 on August 14, 2017, 04:11:15 am
Quote from: live627 – 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.