sylvain 02/02/01 06:48:36 Modified: src/java/org/apache/cocoon/transformation I18nTransformer.java Log: Output the key value if the translation is not found and there's no <untranslated-text> configuration Revision Changes Path 1.6 +5 -5 xml-cocoon2/src/java/org/apache/cocoon/transformation/I18nTransformer.java Index: I18nTransformer.java =================================================================== RCS file: /home/cvs/xml-cocoon2/src/java/org/apache/cocoon/transformation/I18nTransformer.java,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- I18nTransformer.java 30 Jan 2002 14:56:12 -0000 1.5 +++ I18nTransformer.java 1 Feb 2002 14:48:36 -0000 1.6 @@ -129,8 +129,8 @@ * catalogue (<i>mandatory</i>). * <li><strong>catalogue-location</strong>: location of the * message catalogues (<i>mandatory</i>). - * <li><strong>untranslated-text</strong>: default text used for - * untranslated keys (default is 'untranslated-text'). + * <li><strong>untranslated-text</strong>: text used for + * untranslated keys (default is to output the key name). * <li><strong>cache-at-startup</strong>: flag whether to cache * messages at startup (false by default). * </ul> @@ -670,7 +670,7 @@ // obtain default text to use for untranslated messages child = conf.getChild(I18N_UNTRANSLATED); - untranslated = child.getValue(I18N_UNTRANSLATED); + untranslated = child.getValue(null); debug("Default untranslated text is '" + untranslated + "'"); // obtain config option, whether to cache messages at startup time @@ -1032,7 +1032,7 @@ // reset the key holding variable current_key = null; } else { // use text value as dictionary key - translated_text = getString(textValue, untranslated); + translated_text = getString(textValue, (untranslated == null) ? textValue : untranslated); } break; @@ -1097,7 +1097,7 @@ int attr_index = temp_attr.getIndex(attr_name); if (attr_index != -1) { String text2translate = temp_attr.getValue(attr_index); - String result = getString(text2translate, untranslated); + String result = getString(text2translate, (untranslated == null) ? text2translate : untranslated); // set the translated value if (result != null) {
---------------------------------------------------------------------- In case of troubles, e-mail: [EMAIL PROTECTED] To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]