This is an automated email from the ASF dual-hosted git repository. jleroux pushed a commit to branch trunk in repository https://gitbox.apache.org/repos/asf/ofbiz-framework.git
commit 6c6f1e1135cba6a35ac4c5eb37bcc3db743c3817 Author: Jacques Le Roux <jacques.le.r...@les7arts.com> AuthorDate: Sun May 31 12:36:44 2020 +0200 Improved: Rainbow theme: use the United Nations flag ad default flag (OFBIZ-11705) This follows OFBIZ-9866: where I proposed to use the United Nations flag as default flag Pierre noticed that no flag shows when a meta language (like en) is chosen. I noticed that some meta language have default values (gb, fr, zh, th). So I did not apply Pierre's GH PR#154 to keep those, because that can be increased. I added the un.svg flag from https://en.wikipedia.org/wiki/United_Nations I did not adapt its size. Since it's SVG it should be OK in most cases I also added the necessary change at the end of in flag-icon.min.css Thanks: Pierre Smits for the initial patch --- themes/rainbowstone/template/includes/Avatar.ftl | 10 ++++++---- themes/rainbowstone/webapp/rainbowstone/flag-icon.min.css | 2 +- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/themes/rainbowstone/template/includes/Avatar.ftl b/themes/rainbowstone/template/includes/Avatar.ftl index b32a43d..0100f36 100644 --- a/themes/rainbowstone/template/includes/Avatar.ftl +++ b/themes/rainbowstone/template/includes/Avatar.ftl @@ -41,10 +41,12 @@ under the License. <a id="user-lang" href="<@ofbizUrl>ListLocales</@ofbizUrl>"> <#assign userLang = locale.toString()> <#assign flagLang = locale.toString()?keep_after_last("_")> - <#if "en" == userLang><#assign flagLang = "GB"></#if> - <#if "fr" == userLang><#assign flagLang = "FR"></#if> - <#if "zh" == userLang><#assign flagLang = "SG"></#if> - <#if "th" == userLang><#assign flagLang = "TH"></#if> + <#if "en" == userLang || "fr" == userLang || "zh" == userLang || "th" == userLang> + <#if "en" == userLang><#assign flagLang = "GB"></#if> + <#if "fr" == userLang><#assign flagLang = "FR"></#if> + <#if "zh" == userLang><#assign flagLang = "SG"></#if> + <#if "th" == userLang><#assign flagLang = "TH"></#if> + <#elseif 2 == userLang?length><#assign flagLang = "UN"></#if> <span class="flag-icon flag-icon-<#if userLang?size <= 2>${userLang}<#else>${flagLang?lower_case}</#if>"><#if userLang?size <= 2>${userLang}<#else>${flagLang}</#if></span> </a> </div> diff --git a/themes/rainbowstone/webapp/rainbowstone/flag-icon.min.css b/themes/rainbowstone/webapp/rainbowstone/flag-icon.min.css index dd768f4..5a8d636 100644 --- a/themes/rainbowstone/webapp/rainbowstone/flag-icon.min.css +++ b/themes/rainbowstone/webapp/rainbowstone/flag-icon.min.css @@ -17,4 +17,4 @@ * under the License. */ -.flag-icon,.flag-icon-background{background-repeat:no-repeat;background-size:contain;background-position:50%}.flag-icon{position:relative;display:inline-block;width:1.33333333em;line-height:1em}.flag-icon:before{content:"\00a0"}.flag-icon.flag-icon-squared{width:1em}.flag-icon-ad{background-image:url(/rainbowstone/flags//4x3/ad.svg)}.flag-icon-ad.flag-icon-squared{background-image:url(/rainbowstone/flags//1x1/ad.svg)}.flag-icon-ae{background-image:url(/rainbowstone/flags//4x3/ae.svg)}.fl [...] \ No newline at end of file +.flag-icon,.flag-icon-background{background-repeat:no-repeat;background-size:contain;background-position:50%}.flag-icon{position:relative;display:inline-block;width:1.33333333em;line-height:1em}.flag-icon:before{content:"\00a0"}.flag-icon.flag-icon-squared{width:1em}.flag-icon-ad{background-image:url(/rainbowstone/flags//4x3/ad.svg)}.flag-icon-ad.flag-icon-squared{background-image:url(/rainbowstone/flags//1x1/ad.svg)}.flag-icon-ae{background-image:url(/rainbowstone/flags//4x3/ae.svg)}.fl [...] \ No newline at end of file