Run time Application Language Translation with database output - jsf

I have one application having property file for both languages and my JSF UI is now got translated to desired language.
My problem is with the database inputs. I want a common database which will support both languages eg. French and English. But when application language changes it should change the output and input.
That means if I type some word in french by selecting French as my application language at run time it should translate it to English and save it to database and vice versa for the query output.
My project uses maven java and PrimeFaces
Thanks in advance. Waiting for solution

Related

How to add a new language to SAP Hybris e- Commerce Storefront(Electronics UK Website)

My requirement: I want to add one more language say Spanish in footer section of language drop down list on Electronic UK storefront. Once we select the Spanish language our website content should change to Spanish Language.
I have read the hybris wiki related to Internationalization and Localization but I could not find any optimal solution.
Please help me in this to achieve the above functionality.
Open hmc or backoffice. Open your current base store, navigate to languages and add spanish to the list.
Notice, that there will be no data for the language, so your homepage might look very empty.
If you want to add localizations for the cms and product content, you have to add the language to all your catalog versions. Otherwise, your language wont show up in the cmscockpit/productcockpit.
Everything that appears on your homepage as words separated by dots (e.g. "search.placeholder") is not saved in the database. Those are spring messages. They are maintained in a file in your storefront. Find them in
/mystorefront/web/webroot/WEB-INF/messages/
by the names
base_XX.properties
theme-my-theme_XX.properties
site-my-site_XX.properties
where XX is the isocode of your language (in your case es). If the file does not exist, create it. You can use the english file (e.g. base_en.properties) as a template and change the values to spanish ones. Beware, there are a LOT!
There might be more pitfalls, but those are the ones, that came to my mind.

textual syntax for domain models

we have domain models described in some xml format. Given the domain models I want to generate tooling that helps the testers/domain experts to express data in text (and a domain specific test framework later). IDE support is mandatory (IDEA or eclipse).
say, i have this pseudo model
User
fn string 120 chars mandatory
ln string 120 chars mandatory
address not-mandatory
Address
street mandatory
city mandatory
A typical usage scenario:
user opens the IDE
creates a new file
when content assist invoked, should give options 'user', 'address' etc
If I choose user, furthur ctrl-space should give 'fn', 'ln', 'address' as options.
I know this can be done by xtext or jetbrains mps etc. But, I want to understand which technology lends for the following requirements.
the models are fed to the system at run time (new, updates, deletes etc).
so, I cannot have static set of grammars. How can I structure it so that the model/property assist is resolved at run time or at least the grammar is generated (may be a part of it)
when I am working with one set of 'grammars' , if I point my target server to a different version (which may have different set of models) , I want the editor validate my existing files and flag errors.
I get the data files in xml, text or via server lookups.
It is very important for me to transform the models into some other format or interpret them in java/groovy.
for ex,
I may have the following data file
user {
fn : Tom
ln : Jill
hobby : movies
}
but, when I validate this file against a server which does not know 'hobby' property, I want the editor to mark error on that property.
I have plans to add much more functionality to this dsl/toolkit.
Any hints which technology is more suitable ?
thanks
I know this can be done by xtext or jetbrains mps etc. But, I want to understand which technology lends for the following requirements.
I think Xtext is good for your requirements under the condition that you have (or can create) an XML schema for your XML domain models.
the models are fed to the system at run time (new, updates, deletes etc). so, I cannot have static set of grammars. How can I structure it so that the model/property assist is resolved at run time or at least the grammar is generated (may be a part of it)
If I understand you correctly, you don't really need specific grammar rules for each XML data model but only cross references to the data model.
EMF has support for generating EMF Java classes from XSD files and Xtext can reference XML files conforming to the XSD schema if you add them to the Xtext index using your custom indexer (Xtext interface IDefaultResourceDescriptionStrategy).
So you can create a normal Xtext project with grammar etc. for your DSL and use cross references that refer to your XML domain model.
when I am working with one set of 'grammars' , if I point my target server to a different version (which may have different set of models) , I want the editor validate my existing files and flag errors.
I get the data files in xml, text or via server lookups.
EMF uses URIs to identify resources so if you generate an Ecore model like I described, it should be possible to import the XML domain models using http:// or file:// (or whatever, it's extensible) URIs, or something that you internally resolve to URIs.
It is very important for me to transform the models into some other format or interpret them in java/groovy.
Here you have the choice between making an interpreter, an Xbase inferrer or a generator (each of which can be implemented well using Xtend), depending on your requirements.
(Disclaimer: I am an employee at itemis, which is one of the main contributors to Xtext)

How generate container page in English language in opencms8.5

I am new in opencms.I am working on application of opencms8.5 . Actually my application already developed in struts and spring and now i have to integrate that with opencms . Actually when i am trying to generate container page in English then it's creating page in Punjabi language. Can some one tell me how i have to do that.
second question is while i am trying to change my folder name in opencms workplace then it's giving error
Runtime error in JPA layer: org.apache.openjpa.persistence.PersistenceException
Please help me .
I have a few questions, the language you want is in the workplace? or the text onlie/offline?
For the wokplace
you just have to chage your language preferences.
For the pages:
I guess your cms is set on English and Punjabi. So you have to search for the porperty locale or locale-availabe (the second one is for change between languages in the elements) in the container page or folder set the locale "en".

language change of whole application JSF automatically

I need to change the language of whole project. I am using jsf. In default I used English. Now i need to convert it in Italian and Spanish.
I did it by manually writing in the property class. Just like:
and in xhtml I need to to put the property by manually.
My question is that, is there any way to convert it automatically?? I mean I just click on Italian, and it will display in italian language.
You need to create one file by language (with the correct name)
And fill every - key manually ...
Netbeans help you to display all languages in the same table.
The automaticaly option is Google trad.. it's not good solution.

multiple application language in iTunes

I develop a application and submit it on iTunes. and i also did localization for this application for German language. but in German market it showing Language : English. but i want to show both language English and German. like attach sample is showing :
Thx
Mitesh
see your localization string name change it to localizable.strings and then whatever your key put in your whatever language file.

Resources