Guys,

I have a situation where I want to localize a bunch of dynamic texts,
however the current behavior of S.? is to return the input text if its
found in a resource bundle. Whilst I see the rational for this, I have
another situation where I want to pass a key, and if it doesn't find
it, display something else (the english version). Id rather not use
the english text as the translation key, as if the english text
changes, my database translations will break (not good!)

I can achieve the functionality needed right by doing something like:

        S.loc(item.localization_key.toString + ".name") match {
          case Full(t) => t
          case _ => Text(doc.name.toString)
        }

But it would be nice if we could have a utility method in S which
allowed you do do:

?("my.localization.key", defaultText.toString)

Thoughts?

Cheers, Tim
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Lift" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to