From c574f3a7672e1539a1e39c644b6612ff15159d78 Mon Sep 17 00:00:00 2001 From: Vassilii Khachaturov Date: Mon, 20 Jan 2014 11:17:33 +0200 Subject: [PATCH] l10n: trying to add context for "Name:" "Name" as in "Personal name" is different from "Name" as in "identification of a repository" or in "place name", at least in Russian. Splitting away "repo|Name:" and "place|Name:" We need to dynamically set the labels in glade. See gramps-devel thread "context support for labels in glade?" --- gramps/gen/filters/rules/place/_hasplace.py | 4 ++-- gramps/gen/filters/rules/repository/_hasrepo.py | 4 ++-- gramps/gui/editors/editplace.py | 5 +++-- gramps/gui/glade/editplace.glade | 4 ++-- gramps/gui/glade/mergeplace.glade | 4 ++-- gramps/gui/glade/mergerepository.glade | 4 ++-- gramps/gui/merge/mergeplace.py | 3 +++ gramps/gui/merge/mergerepository.py | 4 +++- 8 files changed, 19 insertions(+), 13 deletions(-) diff --git a/gramps/gen/filters/rules/place/_hasplace.py b/gramps/gen/filters/rules/place/_hasplace.py index f83f88813..613a40464 100644 --- a/gramps/gen/filters/rules/place/_hasplace.py +++ b/gramps/gen/filters/rules/place/_hasplace.py @@ -28,7 +28,7 @@ # #------------------------------------------------------------------------- from ....const import GRAMPS_LOCALE as glocale -_ = glocale.translation.gettext +_ = glocale.translation.sgettext #------------------------------------------------------------------------- # @@ -47,7 +47,7 @@ from ....utils.location import get_locations class HasPlace(Rule): """Rule that checks for a place with a particular value""" - labels = [ _('Name:'), + labels = [ _('place|Name:'), _('Street:'), _('Locality:'), _('City:'), diff --git a/gramps/gen/filters/rules/repository/_hasrepo.py b/gramps/gen/filters/rules/repository/_hasrepo.py index e26d42395..c962c64cd 100644 --- a/gramps/gen/filters/rules/repository/_hasrepo.py +++ b/gramps/gen/filters/rules/repository/_hasrepo.py @@ -26,7 +26,7 @@ # #------------------------------------------------------------------------- from ....const import GRAMPS_LOCALE as glocale -_ = glocale.translation.gettext +_ = glocale.translation.sgettext #------------------------------------------------------------------------- # @@ -45,7 +45,7 @@ class HasRepo(Rule): """Rule that checks for a repo with a particular value""" - labels = [ _('Name:'), + labels = [ _('repo|Name:'), _('Type:'), _('Address:'), _('URL:'), diff --git a/gramps/gui/editors/editplace.py b/gramps/gui/editors/editplace.py index 40c3b55f9..0128e018d 100644 --- a/gramps/gui/editors/editplace.py +++ b/gramps/gui/editors/editplace.py @@ -21,8 +21,6 @@ # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # -# $Id$ - #------------------------------------------------------------------------- # # python modules @@ -32,6 +30,7 @@ from __future__ import unicode_literals from gramps.gen.const import GRAMPS_LOCALE as glocale _ = glocale.translation.gettext +_T_ = glocale.translation.sgettext import logging log = logging.getLogger(".") @@ -80,6 +79,8 @@ class EditPlace(EditPrimary): self.top = Glade() self.set_window(self.top.toplevel, None, self.get_menu_title()) + self.place_name_label = self.top.get_object('place_name_label') + self.place_name_label.set_text(_('place|Name:')) def get_menu_title(self): if self.obj and self.obj.get_handle(): diff --git a/gramps/gui/glade/editplace.glade b/gramps/gui/glade/editplace.glade index 4816221d5..e840b5350 100644 --- a/gramps/gui/glade/editplace.glade +++ b/gramps/gui/glade/editplace.glade @@ -305,11 +305,11 @@ You can set these values via the Geography View by searching the place, or via a - + True False 0 - Name: + place|Name: 1 diff --git a/gramps/gui/glade/mergeplace.glade b/gramps/gui/glade/mergeplace.glade index 6993b1543..95df28901 100644 --- a/gramps/gui/glade/mergeplace.glade +++ b/gramps/gui/glade/mergeplace.glade @@ -471,7 +471,7 @@ primary data for the merged place. - Name: + place|Name: True True False @@ -490,7 +490,7 @@ primary data for the merged place. - Name: + place|Name: True True False diff --git a/gramps/gui/glade/mergerepository.glade b/gramps/gui/glade/mergerepository.glade index c4a7077d2..52abe4cc5 100644 --- a/gramps/gui/glade/mergerepository.glade +++ b/gramps/gui/glade/mergerepository.glade @@ -215,7 +215,7 @@ primary data for the merged repository. - Name: + repo|Name: False True True @@ -234,7 +234,7 @@ primary data for the merged repository. - Name: + repo|Name: False True True diff --git a/gramps/gui/merge/mergeplace.py b/gramps/gui/merge/mergeplace.py index ce2446ffc..56873db32 100644 --- a/gramps/gui/merge/mergeplace.py +++ b/gramps/gui/merge/mergeplace.py @@ -53,6 +53,7 @@ WIKI_HELP_PAGE = '%s_-_Entering_and_Editing_Data:_Detailed_-_part_3' % \ URL_MANUAL_PAGE WIKI_HELP_SEC = _('manual|Merge_Places') _GLADE_FILE = 'mergeplace.glade' +PLACE_NAME = _('place|Name:') #------------------------------------------------------------------------- # @@ -87,6 +88,8 @@ class MergePlace(ManagedWindow): for widget_name in ('title1', 'title2', 'title_btn1', 'title_btn2'): self.get_widget(widget_name).set_sensitive(False) + for widget_name in ('name_btn1', 'name_btn2'): + self.get_widget(widget_name).set_label(PLACE_NAME) entry1 = self.get_widget("name1") entry2 = self.get_widget("name2") entry1.set_text(self.pl1.get_name()) diff --git a/gramps/gui/merge/mergerepository.py b/gramps/gui/merge/mergerepository.py index 2df39c90e..672a9f69d 100644 --- a/gramps/gui/merge/mergerepository.py +++ b/gramps/gui/merge/mergerepository.py @@ -18,7 +18,6 @@ # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # -# $Id$ """ Provide merge capabilities for repositories. @@ -45,6 +44,7 @@ WIKI_HELP_PAGE = '%s_-_Entering_and_Editing_Data:_Detailed_-_part_3' % \ URL_MANUAL_PAGE WIKI_HELP_SEC = _('manual|Merge_Repositories') _GLADE_FILE = 'mergerepository.glade' +REPO_NAME = _('repo|Name:') #------------------------------------------------------------------------- # @@ -70,6 +70,8 @@ class MergeRepository(ManagedWindow): # Detailed selection widgets name1 = self.rp1.get_name() name2 = self.rp2.get_name() + for widget_name in ('name_btn1', 'name_btn2'): + self.get_widget(widget_name).set_label(PLACE_NAME) entry1 = self.get_widget('name1') entry2 = self.get_widget('name2') entry1.set_text(name1)