ElkArte Community

Extending Elk => Localization => Topic started by: Ice (NegativeIQ) on August 14, 2015, 11:19:44 pm

Title: Who.language.php
Post by: Ice (NegativeIQ) on August 14, 2015, 11:19:44 pm
Just continued translating to Serbian after a very long time. And while i were translating Who file, i stumbled upon two last strings being %1$s

Guess its just some Transifex import bug, and that it wont interfere with how forum is working but maybe we shall fix it?
I just wonder how nobody reported these thing...
Title: Re: Who.language.php
Post by: Flavio93Zena on August 15, 2015, 12:33:20 am
Nope, they are variables, just copy/paste them the way they are.
Title: Re: Who.language.php
Post by: Ice (NegativeIQ) on August 15, 2015, 01:25:32 am
In that case they are useless there...or im missing something???
Title: Re: Who.language.php
Post by: Flavio93Zena on August 15, 2015, 02:16:17 am
Like I said... Leave them the way they are! Being a translator (I assume you are, since you said you got on it after a long time), you should know that translations may include variables for stuff like "This topic has X views", where that "X" is actually "%1$s".

Disclaimer: if I sound like a rude @ss, I had a pretty bad day, sorry.
Title: Re: Who.language.php
Post by: live627 on August 15, 2015, 05:06:24 am
Don't change or remove them--sprintf() replaces them with variables.
Title: Re: Who.language.php
Post by: Ice (NegativeIQ) on August 15, 2015, 10:55:23 am
I know that they are just passing input string to output as there is no text actually being formated (input is passed just the way it is), and thats why i said they are useless...

Anyway i just wanted to report these but if you guys left it that way on purpose (and not being lazy :D) than just say it. xD
Title: Re: Who.language.php
Post by: emanuele on August 15, 2015, 12:28:15 pm
Do you remember the key of the string?
Title: Re: Who.language.php
Post by: Flavio93Zena on August 15, 2015, 12:59:52 pm
@emanuele
Title: Re: Who.language.php
Post by: Adrek on August 15, 2015, 01:01:48 pm
@Flavio93Zena key is between $txt[' and '] :)
Title: Re: Who.language.php
Post by: Flavio93Zena on August 15, 2015, 01:06:17 pm
Oh he meant that xD Nvm then ;D
Title: Re: Who.language.php
Post by: Ice (NegativeIQ) on August 15, 2015, 05:03:41 pm
Code: [Select]
// Overrides the already defined strings to get clean results in the table
$txt['today'] = '%1$s';
$txt['yesterday'] = '%1$s';

Thats from downloaded file...
Title: Re: Who.language.php
Post by: emanuele on August 16, 2015, 02:28:09 am
I wonder why I didn't just search in the file... xD
Forgive me, I had a very "full day" yesterday and I was quite tired. :)

Well, as the notes says, the two variable are already defined elsewhere (index.template.php in that case), and there is the need to override them (yeah, it really need the variable as it is because they are used in the function that prettify the dates and times).
Why didn't I do it in a "source" file, but in a language files? I guess I thought it could be handy have them there just in case someone needs them and that translated these two variables doesn't really take much efforts. LOL

If you think it's better to move them out of the language files it's not a big problem, it can be done in 1.1.
Title: Re: Who.language.php
Post by: Flavio93Zena on August 16, 2015, 02:32:12 am
Tbh, I'd leave them there due to the way some languages are. You should know very well the way Italian is, it's often different from English, so you might have the variable in one place or another according to the language, not sure how you could fix that if you placed the variable into a source file. You'd have to place another wild card there but it'd annihilate the whole purpose of the "fix".
Title: Re: Who.language.php
Post by: emanuele on August 16, 2015, 02:45:48 am
In theory it's just for the table, so it may be fine with just the time, but I have to check the code again.