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?"
This commit is contained in:
Vassilii Khachaturov 2014-01-20 11:17:33 +02:00
parent ef8be443ae
commit c574f3a767
8 changed files with 19 additions and 13 deletions

View File

@ -28,7 +28,7 @@
# #
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
from ....const import GRAMPS_LOCALE as glocale 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): class HasPlace(Rule):
"""Rule that checks for a place with a particular value""" """Rule that checks for a place with a particular value"""
labels = [ _('Name:'), labels = [ _('place|Name:'),
_('Street:'), _('Street:'),
_('Locality:'), _('Locality:'),
_('City:'), _('City:'),

View File

@ -26,7 +26,7 @@
# #
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
from ....const import GRAMPS_LOCALE as glocale 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""" """Rule that checks for a repo with a particular value"""
labels = [ _('Name:'), labels = [ _('repo|Name:'),
_('Type:'), _('Type:'),
_('Address:'), _('Address:'),
_('URL:'), _('URL:'),

View File

@ -21,8 +21,6 @@
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
# #
# $Id$
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
# #
# python modules # python modules
@ -32,6 +30,7 @@ from __future__ import unicode_literals
from gramps.gen.const import GRAMPS_LOCALE as glocale from gramps.gen.const import GRAMPS_LOCALE as glocale
_ = glocale.translation.gettext _ = glocale.translation.gettext
_T_ = glocale.translation.sgettext
import logging import logging
log = logging.getLogger(".") log = logging.getLogger(".")
@ -80,6 +79,8 @@ class EditPlace(EditPrimary):
self.top = Glade() self.top = Glade()
self.set_window(self.top.toplevel, None, self.get_menu_title()) 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): def get_menu_title(self):
if self.obj and self.obj.get_handle(): if self.obj and self.obj.get_handle():

View File

@ -305,11 +305,11 @@ You can set these values via the Geography View by searching the place, or via a
</packing> </packing>
</child> </child>
<child> <child>
<object class="GtkLabel" id="label3"> <object class="GtkLabel" id="place_name_label">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">False</property> <property name="can_focus">False</property>
<property name="xalign">0</property> <property name="xalign">0</property>
<property name="label" translatable="yes">Name:</property> <property name="label" translatable="yes">place|Name:</property>
</object> </object>
<packing> <packing>
<property name="top_attach">1</property> <property name="top_attach">1</property>

View File

@ -471,7 +471,7 @@ primary data for the merged place.</property>
</child> </child>
<child> <child>
<object class="GtkRadioButton" id="name_btn1"> <object class="GtkRadioButton" id="name_btn1">
<property name="label" translatable="yes">Name:</property> <property name="label" translatable="yes">place|Name:</property>
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">True</property> <property name="can_focus">True</property>
<property name="receives_default">False</property> <property name="receives_default">False</property>
@ -490,7 +490,7 @@ primary data for the merged place.</property>
</child> </child>
<child> <child>
<object class="GtkRadioButton" id="name_btn2"> <object class="GtkRadioButton" id="name_btn2">
<property name="label" translatable="yes">Name:</property> <property name="label" translatable="yes">place|Name:</property>
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">True</property> <property name="can_focus">True</property>
<property name="receives_default">False</property> <property name="receives_default">False</property>

View File

@ -215,7 +215,7 @@ primary data for the merged repository.</property>
</child> </child>
<child> <child>
<object class="GtkRadioButton" id="name_btn1"> <object class="GtkRadioButton" id="name_btn1">
<property name="label" translatable="yes">Name:</property> <property name="label" translatable="yes">repo|Name:</property>
<property name="use_action_appearance">False</property> <property name="use_action_appearance">False</property>
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">True</property> <property name="can_focus">True</property>
@ -234,7 +234,7 @@ primary data for the merged repository.</property>
</child> </child>
<child> <child>
<object class="GtkRadioButton" id="name_btn2"> <object class="GtkRadioButton" id="name_btn2">
<property name="label" translatable="yes">Name:</property> <property name="label" translatable="yes">repo|Name:</property>
<property name="use_action_appearance">False</property> <property name="use_action_appearance">False</property>
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">True</property> <property name="can_focus">True</property>

View File

@ -53,6 +53,7 @@ WIKI_HELP_PAGE = '%s_-_Entering_and_Editing_Data:_Detailed_-_part_3' % \
URL_MANUAL_PAGE URL_MANUAL_PAGE
WIKI_HELP_SEC = _('manual|Merge_Places') WIKI_HELP_SEC = _('manual|Merge_Places')
_GLADE_FILE = 'mergeplace.glade' _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'): for widget_name in ('title1', 'title2', 'title_btn1', 'title_btn2'):
self.get_widget(widget_name).set_sensitive(False) 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") entry1 = self.get_widget("name1")
entry2 = self.get_widget("name2") entry2 = self.get_widget("name2")
entry1.set_text(self.pl1.get_name()) entry1.set_text(self.pl1.get_name())

View File

@ -18,7 +18,6 @@
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
# #
# $Id$
""" """
Provide merge capabilities for repositories. Provide merge capabilities for repositories.
@ -45,6 +44,7 @@ WIKI_HELP_PAGE = '%s_-_Entering_and_Editing_Data:_Detailed_-_part_3' % \
URL_MANUAL_PAGE URL_MANUAL_PAGE
WIKI_HELP_SEC = _('manual|Merge_Repositories') WIKI_HELP_SEC = _('manual|Merge_Repositories')
_GLADE_FILE = 'mergerepository.glade' _GLADE_FILE = 'mergerepository.glade'
REPO_NAME = _('repo|Name:')
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
# #
@ -70,6 +70,8 @@ class MergeRepository(ManagedWindow):
# Detailed selection widgets # Detailed selection widgets
name1 = self.rp1.get_name() name1 = self.rp1.get_name()
name2 = self.rp2.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') entry1 = self.get_widget('name1')
entry2 = self.get_widget('name2') entry2 = self.get_widget('name2')
entry1.set_text(name1) entry1.set_text(name1)