|
Author: erwan
Date: Thu Dec 9 21:11:16 2010 New Revision: 1044132 URL: http://svn.apache.org/viewvc?rev=1044132&view=rev Log: Closing OFBIZ-4051 i18n for elrte editor - this will add the included translation in the erlte project to be used. Thanks Jacques and Sascha Modified: ofbiz/branches/jquery/framework/widget/src/org/ofbiz/widget/form/MacroFormRenderer.java ofbiz/branches/jquery/framework/widget/templates/csvFormMacroLibrary.ftl ofbiz/branches/jquery/framework/widget/templates/foFormMacroLibrary.ftl ofbiz/branches/jquery/framework/widget/templates/htmlFormMacroLibrary.ftl ofbiz/branches/jquery/framework/widget/templates/textFormMacroLibrary.ftl ofbiz/branches/jquery/framework/widget/templates/xmlFormMacroLibrary.ftl Modified: ofbiz/branches/jquery/framework/widget/src/org/ofbiz/widget/form/MacroFormRenderer.java URL: http://svn.apache.org/viewvc/ofbiz/branches/jquery/framework/widget/src/org/ofbiz/widget/form/MacroFormRenderer.java?rev=1044132&r1=1044131&r2=1044132&view=diff ============================================================================== --- ofbiz/branches/jquery/framework/widget/src/org/ofbiz/widget/form/MacroFormRenderer.java (original) +++ ofbiz/branches/jquery/framework/widget/src/org/ofbiz/widget/form/MacroFormRenderer.java Thu Dec 9 21:11:16 2010 @@ -431,6 +431,11 @@ public class MacroFormRenderer implement if (textareaField.isReadOnly()) { readonly = "readonly"; } + Map<String, Object> userLogin = UtilGenerics.checkMap(context.get("userLogin")); + String language = "en"; + if (userLogin != null) { + language = UtilValidate.isEmpty((String) userLogin.get("lastLocale")) ? "en" : (String) userLogin.get("lastLocale"); + } String value = modelFormField.getEntry(context, textareaField.getDefaultValue(context)); StringWriter sr = new StringWriter(); sr.append("<@renderTextareaField "); @@ -452,6 +457,8 @@ public class MacroFormRenderer implement sr.append(readonly); sr.append("\" visualEdtiorEnalble=\""); sr.append(visualEdtiorEnalble); + sr.append("\" language=\""); + sr.append(language); sr.append("\" buttons=\""); sr.append(buttons); sr.append("\" />"); Modified: ofbiz/branches/jquery/framework/widget/templates/csvFormMacroLibrary.ftl URL: http://svn.apache.org/viewvc/ofbiz/branches/jquery/framework/widget/templates/csvFormMacroLibrary.ftl?rev=1044132&r1=1044131&r2=1044132&view=diff ============================================================================== --- ofbiz/branches/jquery/framework/widget/templates/csvFormMacroLibrary.ftl (original) +++ ofbiz/branches/jquery/framework/widget/templates/csvFormMacroLibrary.ftl Thu Dec 9 21:11:16 2010 @@ -26,7 +26,7 @@ under the License. <#macro renderTextField name className alert value textSize maxlength id event action disabled clientAutocomplete ajaxUrl ajaxEnabled><@renderField value /></#macro> -<#macro renderTextareaField name className alert cols rows id readonly value visualEdtiorEnalble buttons><@renderField value /></#macro> +<#macro renderTextareaField name className alert cols rows id readonly value visualEdtiorEnalble language buttons><@renderField value /></#macro> <#macro renderDateTimeField name className alert title value size maxlength id dateType shortDateInput timeDropdownParamName defaultDateTimeString localizedIconTitle timeDropdown timeHourName classString hour1 hour2 timeMinutesName minutes isTwelveHour ampmName amSelected pmSelected compositeType formName><@renderField value /></#macro> Modified: ofbiz/branches/jquery/framework/widget/templates/foFormMacroLibrary.ftl URL: http://svn.apache.org/viewvc/ofbiz/branches/jquery/framework/widget/templates/foFormMacroLibrary.ftl?rev=1044132&r1=1044131&r2=1044132&view=diff ============================================================================== --- ofbiz/branches/jquery/framework/widget/templates/foFormMacroLibrary.ftl (original) +++ ofbiz/branches/jquery/framework/widget/templates/foFormMacroLibrary.ftl Thu Dec 9 21:11:16 2010 @@ -50,7 +50,7 @@ under the License. <#macro renderTextField name className alert value textSize maxlength id event action disabled clientAutocomplete ajaxUrl ajaxEnabled><@makeBlock className value /></#macro> -<#macro renderTextareaField name className alert cols rows id readonly value visualEdtiorEnalble buttons><@makeBlock className value /></#macro> +<#macro renderTextareaField name className alert cols rows id readonly value visualEdtiorEnalble language buttons><@makeBlock className value /></#macro> <#macro renderDateTimeField name className alert title value size maxlength id event action dateType shortDateInput timeDropdownParamName defaultDateTimeString localizedIconTitle timeDropdown timeHourName classString hour1 hour2 timeMinutesName minutes isTwelveHour ampmName amSelected pmSelected compositeType formName><@makeBlock className value /></#macro> Modified: ofbiz/branches/jquery/framework/widget/templates/htmlFormMacroLibrary.ftl URL: http://svn.apache.org/viewvc/ofbiz/branches/jquery/framework/widget/templates/htmlFormMacroLibrary.ftl?rev=1044132&r1=1044131&r2=1044132&view=diff ============================================================================== --- ofbiz/branches/jquery/framework/widget/templates/htmlFormMacroLibrary.ftl (original) +++ ofbiz/branches/jquery/framework/widget/templates/htmlFormMacroLibrary.ftl Thu Dec 9 21:11:16 2010 @@ -64,7 +64,7 @@ under the License. </#if> </#macro> -<#macro renderTextareaField name className alert cols rows id readonly value visualEdtiorEnalble buttons> +<#macro renderTextareaField name className alert cols rows id readonly value visualEdtiorEnalble language buttons> <textarea name="${name}"<#t/> <@renderClass className alert /> <#if cols?has_content> cols="${cols}"</#if><#rt/> @@ -77,10 +77,14 @@ under the License. </textarea><#lt/> <#if visualEdtiorEnalble?has_content> <script language="javascript" src="/images/jquery/plugins/elrteEditor/elrte.min.js" type="text/javascript"></script><#rt/> + <#if language?has_content && language != "en"> + <script language="javascript" src="/images/jquery/plugins/elrteEditor/i18n/elrte.${language!"en"}.js" type="text/javascript"></script><#rt/> + </#if> <link href="/images/jquery/plugins/elrteEditor/css/elrte.full.css" rel="stylesheet" type="text/css"> <script language="javascript" type="text/javascript"> var opts = { cssClass : 'el-rte', + lang : '${language!"en"}', toolbar : '${buttons?default("maxi")}', doctype : '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">', //'<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN">', cssfiles : ['/images/jquery/plugins/elrteEditor/css/elrte-inner.css'] Modified: ofbiz/branches/jquery/framework/widget/templates/textFormMacroLibrary.ftl URL: http://svn.apache.org/viewvc/ofbiz/branches/jquery/framework/widget/templates/textFormMacroLibrary.ftl?rev=1044132&r1=1044131&r2=1044132&view=diff ============================================================================== --- ofbiz/branches/jquery/framework/widget/templates/textFormMacroLibrary.ftl (original) +++ ofbiz/branches/jquery/framework/widget/templates/textFormMacroLibrary.ftl Thu Dec 9 21:11:16 2010 @@ -26,7 +26,7 @@ under the License. <#macro renderTextField name className alert value textSize maxlength id event action disabled clientAutocomplete ajaxUrl ajaxEnabled><@renderField value /></#macro> -<#macro renderTextareaField name className alert cols rows id readonly value visualEdtiorEnalble buttons><@renderField value /></#macro> +<#macro renderTextareaField name className alert cols rows id readonly value visualEdtiorEnalble language buttons><@renderField value /></#macro> <#macro renderDateTimeField name className alert title value size maxlength id event action dateType shortDateInput timeDropdownParamName defaultDateTimeString localizedIconTitle timeDropdown timeHourName classString hour1 hour2 timeMinutesName minutes isTwelveHour ampmName amSelected pmSelected compositeType formName><@renderField value /></#macro> Modified: ofbiz/branches/jquery/framework/widget/templates/xmlFormMacroLibrary.ftl URL: http://svn.apache.org/viewvc/ofbiz/branches/jquery/framework/widget/templates/xmlFormMacroLibrary.ftl?rev=1044132&r1=1044131&r2=1044132&view=diff ============================================================================== --- ofbiz/branches/jquery/framework/widget/templates/xmlFormMacroLibrary.ftl (original) +++ ofbiz/branches/jquery/framework/widget/templates/xmlFormMacroLibrary.ftl Thu Dec 9 21:11:16 2010 @@ -42,7 +42,7 @@ under the License. <#macro renderTextField name className alert value textSize maxlength id event action disabled clientAutocomplete ajaxUrl ajaxEnabled><@renderField value/></#macro> -<#macro renderTextareaField name className alert cols rows id readonly value visualEdtiorEnalble buttons><@renderField value/></#macro> +<#macro renderTextareaField name className alert cols rows id readonly value visualEdtiorEnalble language buttons><@renderField value/></#macro> <#macro renderDateTimeField name className alert title value size maxlength id event action dateType shortDateInput timeDropdownParamName defaultDateTimeString localizedIconTitle timeDropdown timeHourName classString hour1 hour2 timeMinutesName minutes isTwelveHour ampmName amSelected pmSelected compositeType formName><@renderField value/></#macro> |
| Free forum by Nabble | Edit this page |
