CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Developer Discussion (Moderator: Donald Lobo) »
  • Changing a few label strings?
Pages: [1]

Author Topic: Changing a few label strings?  (Read 1199 times)

lentilsoup

  • I post frequently
  • ***
  • Posts: 134
  • Karma: 6
Changing a few label strings?
January 24, 2009, 05:44:04 pm
I'd like to change labels strings on a few forms -- e.g. changing the label for the "event summary" field on the Event Info form to "Tagline".  I see that all this text is run through the "ts()" function, but don't see where one would go to change the strings that are substituted without defining an entire custom string substitution funtion.  Is there an easy was to override just a few strings?

Thanks!

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: Changing a few label strings?
January 25, 2009, 06:28:54 am

i think a custom ts function is your best bet. I suspect the function can be a simple wrapper with a associative array for lookup which calls the civicrm ts function if the key is not present.

please publish this function on forums, so other folks can use it. We will consider making your use case simpler in future civicrm function (i.e. potentially integrate some version of your fix :)

lobo


A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

lentilsoup

  • I post frequently
  • ***
  • Posts: 134
  • Karma: 6
Re: Changing a few label strings?
January 25, 2009, 08:48:59 am
OK, that doesn't sound too hard.  I'll have to modify the core code somewhere to pull this function in, right?  Is there a particular place that would be better than any other?

Thanks!

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: Changing a few label strings?
January 25, 2009, 02:55:16 pm

you can specific your own custom translation function in this screen:

http://drupal.demo.civicrm.org/civicrm/admin/setting/localization?reset=1

You can also see how the translate function ts is implemented here: CRM/Core/I18n.php

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Developer Discussion (Moderator: Donald Lobo) »
  • Changing a few label strings?

This forum was archived on 2017-11-26.