?
avatar brianteeman
brianteeman
22 Oct 2014

@aDaneinSpain has created a tool for searching for unused language strings. https://github.com/Jensen-Technologies/Find-Unused-Joomla-Language-Constants

I have done a quick test of one component (banners) it would appear that the tool is finding a lot of unused strings.

Anyone got any suggestions on how we should handle this. Surely it is better not to have unused strings as that just makes the job of translators harder - especially for new languages

avatar brianteeman brianteeman - open - 22 Oct 2014
avatar Bakual
Bakual - comment - 22 Oct 2014

We can remove them with Joomla 4.0.
Mark them deprecated with a comment so we remember :)

----- Ursprüngliche Nachricht -----
Von: Brian Teeman
Gesendet: 22.10.2014 23:11
An: joomla/joomla-cms
Betreff: [joomla-cms] Large number of unused language strings (#4898)

@aDaneinSpain has created a tool for searching for unused language strings. https://github.com/Jensen-Technologies/Find-Unused-Joomla-Language-Constants

I have done a quick test of one component (banners) it would appear that the tool is finding a lot of unused strings.

Anyone got any suggestions on how we should handle this. Surely it is better not to have unused strings as that just makes the job of translators harder - especially for new languages


Reply to this email directly or view it on GitHub:
#4898

avatar brianteeman
brianteeman - comment - 22 Oct 2014

If they are not being used then why cant they be removed now. There is no
b/c issue if an unused language string in com_banners is removed. In 2
years we might not even have com_banners

avatar dgt41
dgt41 - comment - 22 Oct 2014

As long as language files are not “locked” to a specific version strings cannot be removed. Eg: you get swiss lang file for 3.3.7 (latest) but you run on 3.2, if strings are removed in the latest version you get some ugly text… One way to solve this is to lock files per version e.g.. swiss_3-3-7.pkg (or something like that), but I don’t know if there are other side effects doing that.

avatar brianteeman
brianteeman - comment - 22 Oct 2014

There is no reason for someone to be running an old, outdated and insecure version of joomla. A missing language string isnthe least of their problems

This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/4898.

avatar dgt41
dgt41 - comment - 22 Oct 2014

Of course you’re right! I just stated my own, still fresh, experience and the lesson I learned: don’t touch lang files
Maybe a little bent of the rules here is not that bad. We can keep this B/C policy but for all 3.2.X, 3.3.X etc So if you are on 3.3.1 to 3.3.9 get 3.3.9. Or something like that.
It doesn’t really make any sense to keep inflating the files UNTILL 4.0

avatar Bakual
Bakual - comment - 23 Oct 2014

When we wrote the new strategy, we also discussed the language strings in PLT. As far as I remember we decided to not remove them. I couldn't find it in the final document however.

Imho, it doesn't really hurt to keep them. It makes the language packs a little bit bigger in size. It isn't worth the risk of breaking a site by removing one string that is still used (and be it only in an override).

As for new languages: If we can mark the strings as "deprecated" / "no longer used", then translators could skip those if they want.

avatar infograf768
infograf768 - comment - 23 Oct 2014

Indeed, we should not take them off as people using 3.2 may need them.
As I explained on slack:

This means that a user with 3.2.x (because of PHP version) is getting lang packs updates from the last version
=> we can't really cleanup all strings

avatar Bakual
Bakual - comment - 23 Oct 2014

Closing then.
Feel free to deprecate them however.

avatar Bakual Bakual - close - 23 Oct 2014
avatar Bakual Bakual - close - 23 Oct 2014
avatar Bakual Bakual - close - 23 Oct 2014
avatar Bakual Bakual - change - 23 Oct 2014
Status New Closed
Closed_Date 0000-00-00 00:00:00 2014-10-23 08:11:20
avatar brianteeman
brianteeman - comment - 23 Oct 2014

I really dont agree btu its a decision and I respect that. There is no
point in deprectating the strings as by the time we get to 4.0 it will be
irrelevant so I wont waste my time.

@infograf768 can you please paste your comment on slac in here. Not
everyone uses or has access to slac and we should have a single point of
truth. Plus slac isnt archived.

On 23 Oct 2014 09:11, "Thomas Hunziker" notifications@github.com wrote:

Closed #4898 #4898.


Reply to this email directly or view it on GitHub
#4898 (comment).

avatar infograf768
infograf768 - comment - 23 Oct 2014

@brianteeman
thsi was a conversation with Soren when he proposed his script

avatar Bakual
Bakual - comment - 23 Oct 2014

I think it can be reevaluated once we have decoupled the extensions and sorted how to translate them in future. Especially the second part can take some time I guess.

avatar zero-24
zero-24 - comment - 23 Oct 2014

@Bakual so we can add the Reevaluate for v4.0 Label here? https://github.com/joomla/joomla-cms/labels/Reevaluate%20for%20v4.0

avatar Bakual Bakual - change - 23 Oct 2014
Labels Added: ?
avatar Bakual
Bakual - comment - 23 Oct 2014

Done :)

avatar dgt41
dgt41 - comment - 23 Oct 2014

@Bakual What’s the lifespan of 3.2?

avatar Bakual
Bakual - comment - 23 Oct 2014

3.2? End of this month.

avatar infograf768
infograf768 - comment - 23 Oct 2014

@dgt41
I see you coming... :)
We may also have strings no more necessary since 3.2.xx

avatar dgt41
dgt41 - comment - 23 Oct 2014

:+1:

avatar dgt41
dgt41 - comment - 23 Oct 2014

I guess we can do some clean up, in this window… @brianteeman are you still interested?

avatar Bakual
Bakual - comment - 23 Oct 2014

For com_banners, the tool shows me the following constants as not used:

(11 constants) D:\xampp\htdocs\joomla3.3/administrator/language/en-GB/en-GB.com_banners.ini
COM_BANNERS_EDIT_BANNER: Edit Banner
COM_BANNERS_FIELD_CLIENT_NAME_LABEL: Client Name
COM_BANNERS_FIELD_VALUE_USECOMPONENTDEFAULT: -- Use Component Default --
COM_BANNERS_FILENAME: %1$s-banners-tracks-%2$s
COM_BANNERS_HEADING_ACTIVE_ASC: Active ascending
COM_BANNERS_HEADING_ACTIVE_DESC: Active descending
COM_BANNERS_MANAGER: Banner Manager
COM_BANNERS_METADATA: Metadata
COM_BANNERS_NO_CLIENTS_SELECTED: No clients selected
COM_BANNERS_TYPE1: Impressions
COM_BANNERS_TYPE2: Clicks

(2 constants) D:\xampp\htdocs\joomla3.3/administrator/language/en-GB/en-GB.com_banners.sys.ini
COM_BANNERS_CATEGORY_ADD_TITLE: Category Manager: Add A New Banners Category
COM_BANNERS_CATEGORY_EDIT_TITLE: Category Manager: Edit A Banners Category

(2 constants) D:\xampp\htdocs\joomla3.3/language/en-GB/en-GB.mod_banners.ini
MOD_BANNERS_FIELD_CACHETIME_DESC: The time before the module is recached
MOD_BANNERS_FIELD_CACHETIME_LABEL: Cache Time

(0 constants) D:\xampp\htdocs\joomla3.3/language/en-GB/en-GB.mod_banners.sys.ini

Some of them for sure are sure still needed.

avatar aDaneInSpain
aDaneInSpain - comment - 23 Oct 2014

Which ones are still used?

avatar Bakual
Bakual - comment - 23 Oct 2014

That is something one should check :)

avatar infograf768
infograf768 - comment - 23 Oct 2014

@Bakual
For com_banners, incredible but yes, none of these are used anymore...

avatar infograf768
infograf768 - comment - 23 Oct 2014

but the sys,ini
COM_BANNERS_CATEGORY_ADD_TITLE: Category Manager: Add A New Banners Category
COM_BANNERS_CATEGORY_EDIT_TITLE: Category Manager: Edit A Banners Category
are used

avatar aDaneInSpain
aDaneInSpain - comment - 23 Oct 2014

Thanks @infograf768 I will take a look at those.

avatar infograf768
infograf768 - comment - 23 Oct 2014
    if ($lang->hasKey($component_title_key = $component . ($section ? "_$section" : '') . '_CATEGORY_' . ($isNew ? 'ADD' : 'EDIT') . '_TITLE'))
avatar Bakual
Bakual - comment - 23 Oct 2014

@infograf768 That one isn't used. It uses the generic title built a few lines later. com_categories doesn't even load the sys.ini file. The title would have to be in the other language file to take effect :smile:

So in fact all are not used.
The module one is a bit strange in that it now uses strings from the component. Which is a bit of a hack.

avatar Bakual
Bakual - comment - 23 Oct 2014

After asking PLT for the document I found out that I was searching in the old one...
See http://developer.joomla.org/news/586-joomla-development-strategy.html, section 6.1.6. We can't remove strings until 4.0.

avatar infograf768
infograf768 - comment - 24 Oct 2014

@infograf768 That one isn't used. It uses the generic title built a few lines later. com_categories doesn't even load the sys.ini file. The title would have to be in the other language file to take effect :smile:

You are right. In this case it is the code

$title = JText::sprintf('COM_CATEGORIES_CATEGORY_' . ($isNew ? 'ADD' : 'EDIT') . '_TITLE', $this->escape(JText::_($component_section_key)));

which is used.
the sys.ini strings are used in 2.5

avatar infograf768
infograf768 - comment - 24 Oct 2014

But... you are wrong concerning the loading of the sys.ini in 3.x. They are loaded:
**Loaded** : JROOT/administrator/language/en-GB/en-GB.com_banners.sys.ini
:smile:

avatar Bakual
Bakual - comment - 24 Oct 2014

Ah. then they are loaded elsewhere. :smile:

avatar zero-24 zero-24 - change - 24 Aug 2015
Milestone Added:
avatar zero-24 zero-24 - change - 24 Aug 2015
Milestone Added:

Add a Comment

Login with GitHub to post a comment