Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2019-01-23 15:05:23

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 8,620
Website

smd_babel: Manage string translations from the admin side

Managing translation strings in Textpattern has traditionally meant going into the database and fiddling with content there. This is no longer the case. Welcome… smd_babel.

Features

  • Translate strings by group for any installed language from the admin side.
  • Switch between languages, retaining your current site and admin language strings alongside for reference.
  • Add new strings if required.
  • Delete (non-core) strings.
  • Export the pack in any language according to a few matching rules.

Requires Textpattern v4.7.2+

Hopefully useful for translators. Download the plugin from Github and enjoy. Any comments, please raise them here or if you have feature requests / bug feedback, raise an issue.


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Offline

#2 2019-01-23 16:00:00

etc
Developer
Registered: 2010-11-11
Posts: 3,132
Website

Re: smd_babel: Manage string translations from the admin side

Lovely stuff! It was time for smd_next_big_plugin :-)

In “Add translation string” dialog you have two (a bit confusing) Language labels.


etc_[ query | search | pagination | date | tree | cache ]

Offline

#3 2019-01-23 16:56:19

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 8,620
Website

Re: smd_babel: Manage string translations from the admin side

etc wrote #316246:

In “Add translation string” dialog you have two (a bit confusing) Language labels.

Oops, well spotted. Copy ‘n paste fail, and I didn’t notice it because when uploading the new version of the plugin via the Plugin Composer, it used the strings already in the DB.

v1.01 released, thank you.

EDIT: and how did you post exactly at 16:00:00… impressive!

Last edited by Bloke (2019-01-23 16:56:47)


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Offline

#4 2019-01-23 17:34:05

jakob
Admin
From: Germany
Registered: 2005-01-20
Posts: 3,393
Website

Re: smd_babel: Manage string translations from the admin side

Bloke wrote #316243:

Managing translation strings in Textpattern has traditionally meant going into the database and fiddling with content there. This is no longer the case. Welcome… smd_babel.

Excellent! Thank you! That will undoubtedly be very useful.

Bloke wrote #316247:

and how did you post exactly at 16:00:00… impressive!

That was probably etc_stop_time at work!


TXP Builders – finely-crafted code, design and txp

Online

#5 2019-01-23 21:31:53

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 8,620
Website

Re: smd_babel: Manage string translations from the admin side

Minor bug fix v1.0.2 released:

  • Fixes announcement message when adding strings.
  • Auto focuses first input field in dialogs.

The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Offline

#6 2019-01-24 01:59:52

phiw13
Plugin Author
From: Japan
Registered: 2004-02-27
Posts: 1,626
Website

Re: smd_babel: Manage string translations from the admin side

Looks nice and handy. It gave me a handy reminder that I still have a bunch of language strings for a no-longer-used/no-longer-needed plugin that I really should remove. Thanks for that :-)

A minor nit so far – when you insert a smd_babel_delete button (link), could you automatically append a (non-)breaking space after said button. That would leave a bit of air in the line and the string that follows it does not need to abut the button.


Oh, and an issue with the help file which I think is not directly related to the plugin.

Offline

#7 2019-01-24 06:37:51

Pat64
Plugin Author
From: France
Registered: 2005-12-12
Posts: 1,256
Website

Re: smd_babel: Manage string translations from the admin side

[smd_babel] smd_babel_add_string = "Ajouter une chaîne de traduction" smd_babel_export_strings = "Exporter les chaînes" smd_babel_group = "Groupe" smd_babel_key = "Clé" smd_babel_lang = "Langue" smd_babel_lang_site = "Langue du site public" smd_babel_lang_ui = "Langue de l’administration" smd_babel_lang_xlate = "Sélection de la langue" smd_babel_language_not_installed = "Langue {name} non installée." smd_babel_string_deleted = "Chaîne {name} supprimée." smd_babel_string_updated = "Chaîne {name} mise à jour." smd_babel_value = "Chaîne de traduction" tab_smd_babel = "Traductions"
#@language fr
#@admin-side
smd_babel => Traductions
#@smd_babel
smd_babel_add_string => Ajouter une chaîne de traduction
smd_babel_export_strings => Exporter les chaînes
smd_babel_group => Groupe
smd_babel_key => Clé
smd_babel_lang => Langue
smd_babel_lang_site => Langue du site public
smd_babel_lang_ui => Langue de l’administration
smd_babel_lang_xlate => Sélection de la langue
smd_babel_language_not_installed => Langue {name} non installée.
smd_babel_string_deleted => Chaîne {name} supprimée.
smd_babel_string_updated => Chaîne {name} mise à jour.
smd_babel_value => Chaîne de traduction
tab_smd_babel => Traductions

Last edited by Pat64 (2019-01-24 06:40:47)

Offline

#8 2019-01-24 09:23:52

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 8,620
Website

Re: smd_babel: Manage string translations from the admin side

Thanks guys. Fixed and updated in v1.0.3. Glad the plugin’s useful.


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Offline

#9 2019-01-24 10:20:15

Pat64
Plugin Author
From: France
Registered: 2005-12-12
Posts: 1,256
Website

Re: smd_babel: Manage string translations from the admin side

Oh yeah!

On the moment, I didn’t understand the purpose of your plugin, Stef. It’s very useful for… themes! And I love it ;)

Just an idea, Stef (may be it can be difficult):

Could you add a lang attribute to the <txp:text item="" /> Core tag in order to retrieve the corresponding string associated to a lang iso code?

Imagine:

<txp:text item="string" lang='<txp:lang />' />

Offline

#10 2019-01-24 11:11:46

jakob
Admin
From: Germany
Registered: 2005-01-20
Posts: 3,393
Website

Re: smd_babel: Manage string translations from the admin side

Pat64 wrote #316271:

Could you add a lang attribute to the <txp:text item="" /> Core tag in order to retrieve the corresponding string associated to a lang iso code?

Imagine:

<txp:text item="string" lang='<txp:lang />' />

Maybe I’ve misunderstood it, but is not your example the standard situation, e.g.:

is not: <txp:text item="string" lang='<txp:lang />' /> = <txp:text item="string" />.

However, I can imagine a lang attribute would be useful to show another language, for example for a language switcher where you explicitly say lang="fr" or when using a variable that holds the current language of a multi-language site, derived from an url variable, for example. A little while ago, I did a kind of proof of concept for that with a lang attribute with Oleg’s help. I’ll see if I can dig that out again.


TXP Builders – finely-crafted code, design and txp

Online

Board footer

Powered by FluxBB