Show Likes

This section allows you to view all posts where this member received or gave a like to.

1
Bug reports / Re: Cleaning up duplicate language strings
Nao « on October 25th, 2013, 04:23 PM »
Moved these posts to the correct topic...

awk is too esoteric for me. ;)
I'm already in enough of a mess, with having to learn the git intricacies over and over again (because I keep forgetting them), so... Let's not push it too far, eh eh... ;)

Still, I quickly cooked up a small script, because I was stupid enough not to post the script I mentioned in the first post, ahum...

Basically, I copied the languages folder to a new place (languages2), and ran this search & replace regex on it:

\$txt\['([^']+)'] = '(.*?)'; to: $txt['$1'] = '';

And then, ran this PHP on that folder:

Code: [Select]
$arr = array();
foreach (scandir('./languages2/') as $fil)
{
if ($fil == '.' || $fil == '..' || substr($fil, -4) != '.php' || strpos($fil, '.english.') === false)
continue;
$fichier = file('./languages2/' . $fil, FILE_SKIP_EMPTY_LINES | FILE_IGNORE_NEW_LINES);
$arr = array_merge($arr, $fichier);
echo $fil." (" .count($arr).")\n<br>";
}
$b = array_count_values($arr);
foreach ($b as $key => $val)
if (strpos($key, '$txt') !== 0 || $val === 1)
unset($b[$key]);
arsort($b, SORT_NUMERIC);
print_r($b);

Remaining duplicate strings, by number of occurrences:

Code: [Select]
    [$txt['plugins_repo_auth'] = '';] => 2
    [$txt['notification'] = '';] => 2
    [$txt['media_admin_bans_mems_empty'] = '';] => 2
    [$txt['lang_rtl'] = false;] => 2
    [$txt['date_format'] = '';] => 2
    [$txt['not_activated'] = '';] => 2
    [$txt['age'] = '';] => 2
    [$txt['no_password'] = '';] => 2
    [$txt['media_admin_modlog_desc'] = '';] => 2
    [$txt['spider'] = '';] => 2
    [$txt['registration_agreement'] = '';] => 2
    [$txt['pm_read'] = '';] => 2
    [$txt['view_all_members'] = '';] => 2
    [$txt['ip_address'] = '';] => 2
    [$txt['display_name'] = '';] => 2
    [$txt['none'] = '';] => 2
    [$txt['membergroups_add_group'] = '';] => 2
    [$txt['showDrafts_desc'] = '';] => 2
    [$txt['show_drafts_none'] = '';] => 2
    [$txt['showDrafts'] = '';] => 2
    [$txt['spiders'] = '';] => 2
    [$txt['error_invalid_characters_username'] = '';] => 2
    [$txt['preset_infractions'] = '';] => 2
    [$txt['edit_draft'] = '';] => 2
    [$txt['draftAutoPurge'] = array(] => 2
    [$txt['ban_type_hostname'] = '';] => 2
    [$txt['ban_invalid_member'] = '';] => 2
    [$txt['ban_type_member_name'] = '';] => 2
    [$txt['subscriptions'] = '';] => 2
    [$txt['remove_all_drafts'] = '';] => 2
    [$txt['remove_all_drafts_confirm'] = '';] => 2
    [$txt['hidden'] = '';] => 2
    [$txt['media'] = '';] => 2
    [$txt['infraction_points'] = '';] => 2

Posted: October 25th, 2013, 04:21 PM

So, basically, that's not a LOT of strings... And some of them really need to be duplicated, such as showDrafts.