How to change the default locale in GXT? - gxt

I don't need the default english locale, only pt_BR. If I do this:
<extend-property name="locale" values="pt_BR"/>
...it will generate one permutation for english (which is the default locale) and another one for pt_BR. How can I avoid the default english one?

Try to add two lines
<extend-property name="locale" values="pt_BR" />
<set-property-fallback name="locale" value="pt_BR" />
<set-property name="locale" value="pt_BR" />

Related

Decimals translated by browser when a dropdown is used

The dot is removed by the browser and results in a value of 25 if you choose 0.25 (hence the error below).
The example config with listitems results in a dropdown in TFS. This works fine in Firefox. Chrome and Internet Explorer remove the dot and e.g. transform the value 0.5 to 5
<FIELD name="Effort" refname="Microsoft.VSTS.Scheduling.Effort" type="Double" reportable="measure" formula="sum">
<HELPTEXT>The estimated effort to implemented the backlog item</HELPTEXT>
<ALLOWEDVALUES expanditems="true">
<LISTITEM value="0" />
<LISTITEM value="0.25" />
<LISTITEM value="0.5" />
<LISTITEM value="1" />
<LISTITEM value="2" />
<LISTITEM value="3" />
<LISTITEM value="5" />
</ALLOWEDVALUES>
</FIELD>
It can be solved for Internet Explorer by putting English as language preference, but that is not a solution since most of our users have set Dutch. Setting the dot as a decimal separator isn't a solution either, because Dutch uses a comma for that.
How can I solve this without bothering the end user?
You need to define a control field .Please follow this tutorial it will surely help you.
Click here Control field numberFormat
or you can also try my sample
<Control Type="FieldControl" FieldName="Microsoft.VSTS.Scheduling.Effort" Label="Rough Estimation:" LabelPosition="Left" NumberFormat="DecimalNumbers" />
Feel free to ask if it not work .Thanks
Someone from Microsoft found the issue and they are solving it;
"FYI, we found this to be an issue with localization. We are fixing it 😊"

Prettyfaces url style search gmail

Good day:
I am conducting a search using prettyFaces, style gmail.
When I do with gmail, space is replaced by a symbol "+". And in the box is not added the "+".
In my case, when I do the same, in other characters url as in my box are added.
Here the mapping code, and box:
<url-mapping id="search">
<pattern value="/buscar/#{ /.*/ searchBean.q}" />
<view-id value="/faces/reqs/search.xhtml" />
<action>#{searchBean.search}</action>
</url-mapping>
<div class="search">
<h:form id="searchForm">
<span class="button-group">
<p:inputText value="#{searchBean.q}" size="50"/>
<p:commandButton action="pretty:search"/>
</span>
</h:form>
</div>
Thanks for the help.
EDIT:
And if facebook would be because it is a parameter? and as it would be a solution to avoid aparesca special characters in the input?
This is expected behavior. In case of GMail the spaces are part of the "fragment" which is the part after the "#" character. In your PrettyFaces setup, the search term is part of the path.
There are different encoding rules for fragments and path parts of the URL. So PrettyFaces is handling this correctly.

Wrong alias pattern when importing taxonomy terms

I'm trying to leverage Import/Export module to import taxonomies and taxonomy terms like so
<Orchard>
<Data>
<Taxonomy Id="/Identifier=Product-Categories" Status="Published">
<AutoroutePart Alias="eshop/categories" UseCustomPattern="false" />
<IdentityPart Identifier="Product-Categories" />
<TitlePart Title="Product Categories" />
<TaxonomyPart TermTypeName="ProductCategoriesTerm" />
</Taxonomy>
<ProductCategoriesTerm Id="/Identifier=Category-1" Status="Published">
<AutoroutePart UseCustomPattern="false" />
<IdentityPart Identifier="Category-1" />
<TitlePart Title="Test category" />
<TermPart Count="0" Selectable="true" Weight="1" TaxonomyId="/Identifier=Product-Categories" Path="" />
</ProductCategoriesTerm>
</Data>
</Orchard>
ProductCategoriesTerm when created through dashboard has default pattern
{Content.Container.Path}/{Content.Slug} ### my-taxonomy/my-term/sub-term
but importing terms makes them to use just {Content.Slug} ... How do I instruct AutoroutePart to use the default pattern? Tried UseCustomPattern="false" or exclude AutoroutePart with no effect it's just test-category instead of eshop/categories/test-category and won't regenerate even if if I set AutouroutePart to automatically regenerate when editing content and disable custom patterns and it won't revert to default pattern even if I try to publish it through dashboard.
Also it's mandatory to include "Count" for the TermPart when importing, does it affect anything? Sounds like something that should be dynamic and relevant only with export.
When importing taxonomy terms (and I guess any other part that has a container) it's necessary to specify Container for the common part. Without it Container for the part is null and therefore can't resolve {Content.Container.Path} in the alias pattern.
<CommonPart Container="/Identifier=Product-Categories" />
Or if it's nested term then Container is the parent term.

Primefaces rich editor

I'm using primefaces(3.0.M2) rich editor for receiving input from user. The restriction is 5000 characters. When user tries to copy from external sources or beautify the content additional tags are getting added to preserve the format.
Now to validate the max length of 5000, I need to strip out the tags and only count the characters length. How to get the characters alone from in managed bean for validation?
client side validation snippet:
<p:editor id="customerInfo" value="#{companyBean.body}"
required="false" requiredMessage="Info required" height="250" width="450"
validatorMessage="Only 5000 characters allowed">
<f:validateLength maximum="5000" />
</p:editor>
Just to help others like me, which tried to find some answer too!
You can user wigdteVar to access the editor value, like this:
<p:editor
id="iptTextoClausula"
widgetVar="wvMyEditor"
width="790"
height="200"
validator="clausulaEditorValidator"
value="#{clausulasContratadasBean.selectedClauseFull.dsTexto}" />
<script language="Javascript">
wvMyEditor.editor.doc.body.innerText
</script>

Showing a parameterized string for localization purpose

Is there a way to have a parmeterized string in resource bundle? I need this as the order of nouns can be different in different languages.
For e.g. in my English bundle I will have
love_message={0} loves {1}
And my Latin translator will pick it up and do
love_message={0} {1} amet
And in my page I will have something like
<h:outputText value="#{bundle.love_message,John,Jenny}" />
(If this would have been possible)
So that my English translated page reads
Jonh love Jenny
And Latin page reads
John Jenna amet.
How can I achieve this?
Use <h:outputFormat> instead of <h:outputText>. It can take those parameters as <f:param>:
<h:outputFormat value="#{bundle.love_message}">
<f:param value="John" />
<f:param value="Kenny" />
</h:outputFormat>

Resources