[language] add reference in what files current string ids are used #2126

Merged
merged 1 commit into from Jan 28, 2013

Projects

None yet

4 participants

@MartijnKaijser
Member

Nothing exciting really but it is usefull.
@alanwww1 you ok with this?

@alanwww1
Member

This is great! Nice job!
It is a great help for translators and also Devs.

I am thinking if we could remove the unknown located strings from the file. Maybe after a public announce on forums so addon devs can also review them if the use any of them. I think we have a horde of unused strings.

Many thanks for this :-)

@MartijnKaijser
Member

Well unknown could still be used somewhere that I couldn't find. Also they may be widely used makes more sense to have in core language.

@alanwww1
Member

Yes for now it is safer.

@MartijnKaijser MartijnKaijser merged commit 9edb540 into xbmc:master Jan 28, 2013
@biocoder-frodo

I was contemplating on writing some code (c# probably) to find calls to from xbmc.core and other source to get an idea how much is used and what isn't. That would make removing safer since we could document the APIs and then search calls to the localization code. Spoiler: I found a .Format("$LOCALIZE(#contextid)" call in C++ source where you'd expect a direct function call to g_LocalizedStrings.Get() :)

@MartijnKaijser
Member

Not safe since we don't know how many 3rd party rely on these strings. Not all strings are called that way.

@MartijnKaijser MartijnKaijser deleted the MartijnKaijser:strings_locations branch Jan 29, 2013
@biocoder-frodo

Some time ago alanwww1 posted on the forum that there 4-5 ways to get to localized text (C/C++, Python, addon api, etc) I looked in the Wiki for documentation on that and there isn't much....With tooling we could say how much percent is unaccounted for. We could even let 3rd party scan their codebase with those tools(if it were that complicated to tell what is used ;) ) Forum is unavailable so I can't quote alanwww1 atm.

@ramiro

This kind of comments directed at translators should be of the form

#. Used in Confluence

(Note the dot after the #).

Translation tools detect them and show to translators appropriately so the are really sueful in giving them hints that help in the translation process.

Member

Hi !
Reference comments starting with #: show up nicely in Transifex web translation tool.
So translators can see where the string is located.

So perfect like this.

Comments with dot #. are, as you wrote for hints or guidance and not for the location/reference of the string.

See here:
http://www.gnu.org/software/gettext/manual/gettext.html#References

Thanks, cheers

@MartijnKaijser
Member

This is not for translators

@alanwww1
Member

@biocoder-frodo
Unfortunately there are really several ways the localize function gets called.
The worst is when the string is identified with its index number which is passed to a function which might manipulate it and only than it calls the localize function with a size_t variable.

This way of calling can only be traced down by evaluating the code and make manual entries in the automatically generated list. So pretty a hard job to collect out ALL the calls. of course it is not impossible. I was intending to look at it when I have plurals support implemented in xbmc.

Of course any help is much appreciated. C++ is my favourite to keep things cross platform.

Cheers

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment