Skip Menu |

This queue is for tickets about the RT-Extension-MergeUsers CPAN distribution.

Report information
The Basics
Id: 108897
Status: new
Priority: 0/
Queue: RT-Extension-MergeUsers

People
Owner: Nobody in particular
Requestors: ELACOUR [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Wishlist
Broken in: 1.02_01
Fixed in: (no value)



Subject: [patch] Add translations support (including french translation)
See attached patches.
Subject: 0001-Add-missing-loc-calls-for-translatable-strings.patch
From bd795c61c0576d2f320f54b5d9f88e667455ec87 Mon Sep 17 00:00:00 2001 From: Emmanuel Lacour <elacour@easter-eggs.com> Date: Fri, 13 Nov 2015 11:37:17 +0100 Subject: [PATCH 1/3] Add missing loc calls for translatable strings --- .../Admin/Users/Modify.html/RightColumnBottom | 10 +++++----- lib/RT/Extension/MergeUsers.pm | 20 ++++++++++---------- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/html/Callbacks/RT-Extension-MergeUsers/Admin/Users/Modify.html/RightColumnBottom b/html/Callbacks/RT-Extension-MergeUsers/Admin/Users/Modify.html/RightColumnBottom index 4a69a88..341dc57 100644 --- a/html/Callbacks/RT-Extension-MergeUsers/Admin/Users/Modify.html/RightColumnBottom +++ b/html/Callbacks/RT-Extension-MergeUsers/Admin/Users/Modify.html/RightColumnBottom @@ -51,19 +51,19 @@ % my ($EffectiveId) = $UserObj->Attributes->Named("EffectiveId"); % my @MergedUsers = @{$UserObj->GetMergedUsers->Content}; % if ($EffectiveId) { -This user has been merged with <a href="Modify.html?id=<% $EffectiveId->Content %>"> +<&|/l&>This user has been merged with</&> <a href="Modify.html?id=<% $EffectiveId->Content %>"> % my $real = RT::User->new($session{'CurrentUser'}); % $real->Load($EffectiveId->Content); -<% $real->NameAndEmail %></a>; <input type="submit" name="Unmerge" value="Unmerge" /> +<% $real->NameAndEmail %></a>; <input type="submit" name="Unmerge" value="<&|/l&>Unmerge</&>" /> % } elsif (@MergedUsers) { -The following users have been merged into this user:<br> +<&|/l&>The following users have been merged into this user:</&><br> % foreach my $user_id (@MergedUsers) { % my $user = RT::User->new($session{'CurrentUser'}); % $user->LoadOriginal(Id => $user_id); -<% $user->NameAndEmail %><input type="submit" name="Unmerge<%$user_id%>" value="Unmerge"><br> +<% $user->NameAndEmail %><input type="submit" name="Unmerge<%$user_id%>" value="<&|/l&>Unmerge</&>"><br> % } % } else { -Merge this user into: <input name="MergeUser" data-autocomplete="Users" data-autocomplete-return="Name" value="" /> +<&|/l&>Merge this user into:</&> <input name="MergeUser" data-autocomplete="Users" data-autocomplete-return="Name" value="" /> % } </&> <%init> diff --git a/lib/RT/Extension/MergeUsers.pm b/lib/RT/Extension/MergeUsers.pm index 5db539a..1783726 100644 --- a/lib/RT/Extension/MergeUsers.pm +++ b/lib/RT/Extension/MergeUsers.pm @@ -261,34 +261,34 @@ sub MergeInto { # Load the user objects we were called with my $merge; if (ref $user) { - return (0, "User is not loaded") unless $user->id; + return (0, $self->loc("User is not loaded")) unless $user->id; $merge = RT::User->new( $self->CurrentUser ); $merge->Load($user->id); - return (0, "Could not reload user #". $user->id) + return (0, $self->loc("Could not reload user #[_1]", $user->id)) unless $merge->id; } else { $merge = RT::User->new( $self->CurrentUser ); $merge->Load($user); - return (0, "Could not load user '$user'") unless $merge->id; + return (0, $self->loc("Could not load user '[_1]'", $user)) unless $merge->id; } - return (0, "Could not load user to be merged") unless $merge->id; + return (0, $self->loc("Could not load user to be merged")) unless $merge->id; # Get copies of the canonicalized users my $email; my $canonical_self = RT::User->new( $self->CurrentUser ); $canonical_self->Load($self->id); - return (0, "Could not load user to merge into") unless $canonical_self->id; + return (0, $self->loc("Could not load user to merge into")) unless $canonical_self->id; # No merging into yourself! - return (0, "Could not merge @{[$merge->Name]} into itself") + return (0, $self->loc("Could not merge [_1] into itself", @{[$merge->Name]})) if $merge->id == $canonical_self->id; # No merging if the user you're merging into was merged into you # (ie. you're the primary address for this user) my ($new) = $merge->Attributes->Named("EffectiveId"); - return (0, "User @{[$canonical_self->Name]} has already been merged") + return (0, $self->loc("User [_1] has already been merged", @{[$canonical_self->Name]})) if defined $new and $new->Content == $canonical_self->id; # clean the cache @@ -313,14 +313,14 @@ sub MergeInto { $canonical_self->Comments||'', "Merged into ". ($merge->EmailAddress || $merge->Name)." (". $merge->id .")", ); - return (1, "Merged users successfuly"); + return (1, $self->loc("Merged users successfuly")); } sub UnMerge { my $self = shift; my ($current) = $self->Attributes->Named("EffectiveId"); - return (0, "Not a merged user") unless $current; + return (0, $self->loc("Not a merged user")) unless $current; # flush the cache, or the Sets below will # clobber $self @@ -348,7 +348,7 @@ sub UnMerge { $merged_users->Delete; } - return ($merge->id, "Unmerged @{[$self->NameAndEmail]} from @{[$merge->NameAndEmail]}"); + return ($merge->id, $self->loc("Unmerged [_1] from [_2]", @{[$self->NameAndEmail]}, @{[$merge->NameAndEmail]})); } sub SetEmailAddress { -- 2.1.4
Subject: 0002-Add-pot-template-translation-using-RT-extract-messag.patch
From 83c744f7a0cbd3d9628f90e4198e0f0954fa4a9f Mon Sep 17 00:00:00 2001 From: Emmanuel Lacour <elacour@easter-eggs.com> Date: Fri, 13 Nov 2015 11:38:00 +0100 Subject: [PATCH 2/3] Add pot template translation using RT extract-message-catalog script --- po/mergeusers.pot | 69 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 69 insertions(+) create mode 100644 po/mergeusers.pot diff --git a/po/mergeusers.pot b/po/mergeusers.pot new file mode 100644 index 0000000..c66257a --- /dev/null +++ b/po/mergeusers.pot @@ -0,0 +1,69 @@ +#. ($user) +#: lib/RT/Extension/MergeUsers.pm:273 +msgid "Could not load user '%1'" +msgstr "" + +#: lib/RT/Extension/MergeUsers.pm:275 +msgid "Could not load user to be merged" +msgstr "" + +#: lib/RT/Extension/MergeUsers.pm:282 +msgid "Could not load user to merge into" +msgstr "" + +#. (@{[$merge->Name]}) +#: lib/RT/Extension/MergeUsers.pm:285 +msgid "Could not merge %1 into itself" +msgstr "" + +#. ($user->id) +#: lib/RT/Extension/MergeUsers.pm:268 +msgid "Could not reload user #%1" +msgstr "" + +#: lib/RT/Extension/MergeUsers.pm:359 +msgid "Email address in use" +msgstr "" + +#: html/Callbacks/RT-Extension-MergeUsers/Admin/Users/Modify.html/RightColumnBottom:66 +msgid "Merge this user into:" +msgstr "" + +#: html/Callbacks/RT-Extension-MergeUsers/Admin/Users/Modify.html/RightColumnBottom:49 +msgid "Merge user" +msgstr "" + +#: lib/RT/Extension/MergeUsers.pm:316 +msgid "Merged users successfuly" +msgstr "" + +#: lib/RT/Extension/MergeUsers.pm:323 +msgid "Not a merged user" +msgstr "" + +#: html/Callbacks/RT-Extension-MergeUsers/Admin/Users/Modify.html/RightColumnBottom:59 +msgid "The following users have been merged into this user:" +msgstr "" + +#: html/Callbacks/RT-Extension-MergeUsers/Admin/Users/Modify.html/RightColumnBottom:54 +msgid "This user has been merged with" +msgstr "" + +#: html/Callbacks/RT-Extension-MergeUsers/Admin/Users/Modify.html/RightColumnBottom:57 html/Callbacks/RT-Extension-MergeUsers/Admin/Users/Modify.html/RightColumnBottom:63 +msgid "Unmerge" +msgstr "" + +#. (@{[$self->NameAndEmail]}, @{[$merge->NameAndEmail]}) +#: lib/RT/Extension/MergeUsers.pm:351 +msgid "Unmerged %1 from %2" +msgstr "" + +#. (@{[$canonical_self->Name]}) +#: lib/RT/Extension/MergeUsers.pm:291 +msgid "User %1 has already been merged" +msgstr "" + +#: lib/RT/Extension/MergeUsers.pm:264 +msgid "User is not loaded" +msgstr "" + -- 2.1.4
Subject: 0003-Add-French-translation.patch
From 56da9dfbeab062e76b31d3fad8e4b7140a01daff Mon Sep 17 00:00:00 2001 From: Emmanuel Lacour <elacour@easter-eggs.com> Date: Fri, 13 Nov 2015 11:38:47 +0100 Subject: [PATCH 3/3] Add French translation --- po/fr.po | 77 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 77 insertions(+) create mode 100644 po/fr.po diff --git a/po/fr.po b/po/fr.po new file mode 100644 index 0000000..339d696 --- /dev/null +++ b/po/fr.po @@ -0,0 +1,77 @@ +msgid "" +msgstr "" +"PO-Revision-Date: 2015-11-13 10:19+0200\n" +"Last-Translator: Emmanuel Lacour <elacour@home-dn.net>\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#. ($user) +#: lib/RT/Extension/MergeUsers.pm:273 +msgid "Could not load user '%1'" +msgstr "Impossible de charger l'utilisateur '%1'" + +#: lib/RT/Extension/MergeUsers.pm:275 +msgid "Could not load user to be merged" +msgstr "Impossible de charger l'utilisateur à fusionner" + +#: lib/RT/Extension/MergeUsers.pm:282 +msgid "Could not load user to merge into" +msgstr "Impossible de charger l'utilisateur cible" + +#. (@{[$merge->Name]}) +#: lib/RT/Extension/MergeUsers.pm:285 +msgid "Could not merge %1 into itself" +msgstr "Impossible de fusionner %1 dans lui-même" + +#. ($user->id) +#: lib/RT/Extension/MergeUsers.pm:268 +msgid "Could not reload user #%1" +msgstr "Impossible de recharger l'utilisateur #%1" + +#: lib/RT/Extension/MergeUsers.pm:359 +msgid "Email address in use" +msgstr "Adresse email déjà utilisée" + +#: html/Callbacks/RT-Extension-MergeUsers/Admin/Users/Modify.html/RightColumnBottom:66 +msgid "Merge this user into:" +msgstr "Fusionner cet utilisateur dans:" + +#: html/Callbacks/RT-Extension-MergeUsers/Admin/Users/Modify.html/RightColumnBottom:49 +msgid "Merge user" +msgstr "Fusion d'utilisateur" + +#: lib/RT/Extension/MergeUsers.pm:316 +msgid "Merged users successfuly" +msgstr "Fusion réussie" + +#: lib/RT/Extension/MergeUsers.pm:323 +msgid "Not a merged user" +msgstr "N'est pas un utilisateur fusionné" + +#: html/Callbacks/RT-Extension-MergeUsers/Admin/Users/Modify.html/RightColumnBottom:59 +msgid "The following users have been merged into this user:" +msgstr "Les utilisateurs suivants ont été fusionnés dans cet utilisateur:" + +#: html/Callbacks/RT-Extension-MergeUsers/Admin/Users/Modify.html/RightColumnBottom:54 +msgid "This user has been merged with" +msgstr "Cet utilisateur a été fusionné avec" + +#: html/Callbacks/RT-Extension-MergeUsers/Admin/Users/Modify.html/RightColumnBottom:57 html/Callbacks/RT-Extension-MergeUsers/Admin/Users/Modify.html/RightColumnBottom:63 +msgid "Unmerge" +msgstr "Défusionner" + +#. (@{[$self->NameAndEmail]}, @{[$merge->NameAndEmail]}) +#: lib/RT/Extension/MergeUsers.pm:351 +msgid "Unmerged %1 from %2" +msgstr "%1 défusionné de %2" + +#. (@{[$canonical_self->Name]}) +#: lib/RT/Extension/MergeUsers.pm:291 +msgid "User %1 has already been merged" +msgstr "L'utilisateur %1 est déjà fusionné" + +#: lib/RT/Extension/MergeUsers.pm:264 +msgid "User is not loaded" +msgstr "L'utilisateur n'est pas chargé" + -- 2.1.4