[prev in list] [next in list] [prev in thread] [next in thread]
List: kwrite-devel
Subject: Using i18n
From: "Philipp A." <flying-sheep () web ! de>
Date: 2013-05-03 18:56:12
Message-ID: CAN8d9gmPVWjWB00Y61wKrF8iE_XK_DKRDmNJfQ1BbwiYYbZhfw () mail ! gmail ! com
[Download RAW message or body]
[Attachment #2 (multipart/alternative)]
Hi, i've seen some uses of kdecore.i18n popping up in Paté plugins, and
have some recommendations:
2. It takes more than one argument. so for the sake of consistency instead
of doing the ugly
i18n(b'foo %(name)s.') % { 'name': 'bar'}
or even the better
i18n(b'foo {name}.').format(name='bar')
we should do the Qt-style
i18n(b'foo %1.', 'bar')
1. i18n takes byte strings. even on python3. this means that every time a
developer accustomed to python2 who doesn't know it tries to use it, the
plugin WILL break for python3 users.
we have to come up with a solution.
there is a possible solution here, but it involves a fairly convoluted i18n
replacement:
https://projects.kde.org/projects/kde/applications/kate/repository/revisions/master/en \
try/addons/kate/pate/src/plugins/python_console_ipython/python_console_ipython.py#L36
should we add that function to libkatepate and call it a day?
[Attachment #5 (text/html)]
<div dir="ltr"><div><div><div><div>Hi, i've seen some uses of kdecore.i18n popping up \
in Paté plugins, and have some recommendations:<br><div><br></div>2. It takes more \
than one argument. so for the sake of consistency instead of doing the ugly<br> \
i18n(b'foo %(name)s.') % { 'name': 'bar'}<br><div>or even the \
better<br></div><div> i18n(b'foo \
{name}.').format(name='bar')<br></div>we should do the Qt-style<br> \
i18n(b'foo %1.', 'bar')<br> <br></div><div>1. i18n takes byte \
strings. even on python3. this means that every time a developer accustomed to \
python2 who doesn't know it tries to use it, the plugin WILL break for python3 \
users.<br><br></div><div>we have to come up with a solution.<br> <br></div><div>there \
is a possible solution here, but it involves a fairly convoluted i18n \
replacement:<br><a href="https://projects.kde.org/projects/kde/applications/kate/repos \
itory/revisions/master/entry/addons/kate/pate/src/plugins/python_console_ipython/pytho \
n_console_ipython.py#L36">https://projects.kde.org/projects/kde/applications/kate/repo \
sitory/revisions/master/entry/addons/kate/pate/src/plugins/python_console_ipython/python_console_ipython.py#L36</a><br>
<br></div><div>should we add that function to libkatepate and call it a \
day?<br></div></div></div></div></div>
_______________________________________________
KWrite-Devel mailing list
KWrite-Devel@kde.org
https://mail.kde.org/mailman/listinfo/kwrite-devel
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic