Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re: Planning ahead for product name changes

by tadman (Prior)
on Sep 25, 2002 at 09:55 UTC ( [id://200589]=note: print w/replies, xml ) Need Help??


in reply to Planning ahead for product name changes

The other things many programmers dread is when they're asked to perform I18N. Internationalization.

I'm astounded by how much text, usually English, typically appears in code. The most common is seldom issued error messages that are, for whatever reason, presented to the end user.

The one thing you can do is just make a look-up table for text, a sort of linguistic style sheet. This can be translated in its entirety when the time comes, instead of having to dig up every bit and piece in a panic when marketing announces they're moving into the European market. Next month.

A simple thing if you plan in advance, but very difficult if you do it in the end. Now as for the language in URLs, that's an entirely seperate argument.
  • Comment on Re: Planning ahead for product name changes

Replies are listed 'Best First'.
Re: Re: Planning ahead for product name changes
by seattlejohn (Deacon) on Sep 25, 2002 at 15:36 UTC
    I'm astounded by how much text, usually English, typically appears in code. The most common is seldom issued error messages that are, for whatever reason, presented to the end user.

    I started noticing the same thing in my own code and specifically wrote an object class to let me centralize the management of error and similar messages, including ones containing run-time content, like this:
      print $error_messages->file_open_failed($input_file);

    You don't actually have to define a file_open_failed object method; that's syntactic sugar that AUTOLOAD turns into the conceptual equivalent of print $error_messages->construct_message('file_open_failed', 'myfile');.

    In my case the issue wasn't I18N as much as wanting to have consistent messages across a sprawling code base, and keep them in a single place for easier documentation -- but the basic issue is not dissimilar.

    I've made the module available here; sorry for the off-site link, but I haven't yet gotten around to CPANning it. Feedback is welcomed!

    As for things like the name of a program, I sometimes consider that a candidate for use constant..., though unfortunately that doesn't help if you need to change the name in documentation and other collateral. Even macro expansion or search-and-replace isn't perfect, because if you're not careful your documentation may contain phrases like "a FooBar report may contain Bazzes", which after transforming, say, {FooBar => AlphaBar and Baz => Blarg} can become something rather convoluted like "a AlphaBar report may contain Blargzes".

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://200589]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (5)
As of 2024-04-24 08:28 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found