I have customers from many countries, and for each one I need to generate a page with data on it.
In my report I have a similar query: SELECT Name, Address, CodLanguage ... FROM Customers
For each record of this query, I want to generate a page in Jasper Reports with customer data in their respective language (I know its language through this flag CodLanguage).
I want change report language for each customer page (each record). Can i do this using report parameter locale? Or changing some variable for each record? Has anyone had a similar situation? Have any idea what can be done?
Example
I need translate the labels: Name, Address, City, Phone Number and Country in 10 different languages, according to the customer's country language.
This example is only a simplification. I will generate between 3 and 6 report pages for each customer, with many other data.
Thanks!
As far as I can tell, this is not possible using any of the standard resource references:
$R{resource.bundle.property}
msg() function
str() function
For each record, supply the corresponding locale (or determine it based on other data, like the country and city -- chances are Quebec, Canada would be French [fr_CA] while Toronto, Canada would be English [en_CA]).
Once there's a map of locales to locations, use a ResourceBundle (or MessageFormat?) to translate the key for a particular label.
Create a number of resource bundle files with translations for the various labels. The file names must have a suffix that corresponds to the predetermined locale (e.g., Bundle_fr_CA.properties).
Change the label from static text to an expression. The expression instantiates a new resource bundle to look up the key (e.g., "city.name") for its translated value, such as:
ResourceBundle.getBundle("Bundle", new Locale("en", $F{country})).getString("city.name")
How the "en" is determined will be a bit of a chore, unless you can alter the database to get the user's language preferences. This means you'll also have to create a resource bundle for every language/country combination, which can be automated.
Related
I am trying to convert customized data format into FHIR standard. In my example, we have a practitioner (physician) with certain unique id defined by hospital. This unique id is hospital specific, not like NPI or SSN.
My approach is to use identifier element in Practitioner resource where it has system and code. For NPI or SSN, I can add value as is and set identifier.system to associated url. However, for unique id, I am not sure how to define it besides setting value to unique id. Is it possible to create url (system) that meets whatever I need?
The rules for system are here. If you are setting up a FHIR server, then you can define the system that client systems should use for that type of identifier. If you are trying to pass this data to a FHIR server owned/governed by someone else, you would need to understand if that FHIR server can accept values with any system or if there are prescribed ones that are accepted.
I'm working on a multi-tenant application catering to customers in different countries. When displaying measurement results, the display labels measurement values need to be in different languages.
Labels for measurement values received in one tenant will only need to be translated to that tenant's language (we assume that the users will be patients or employers that understand the same language).
What is a good strategy for storing/displaying translated strings? Should I perform translation when storing the values and add a custom value in code.coding or is it better to translate existing code.coding.display values when rendering the view?
FHIR is silent on whether you should translate before storing or when returning data. Do consider the ramifications on digital signatures regardless of approach (anyone adding translations after the instance is signed will break the signature). There's a standard extension for conveying the language of a string and translations of the string - see http://www.hl7.org/fhir/extension-iso21090-st-language.html and http://www.hl7.org/fhir/extension-iso21090-st-translation.html. These work on any string in a FHIR instance.
I am evaluating HippoCMS and am trying to model a schema of Venues. I want to model a document that has non-translatable features such as telephoneNumber and emailAddress, plus translatable features such as description.
How do I model this in HippoCMS? How do I ensure that the non-translated fields are shared between the different translations, to avoid each translated document having its own copy of a value. Obviously no matter which language you are reading a site in, the telephoneNumber shouldn't change.
The only way I have found for the moment is to create a document called Venue and another document called VenueTranslation. Venue would contain the telephoneNumber and VenueTranslation would contain its description and a link back to the Venue document. There would then be VenueTranslation documents for each language.
Is this the correct approach?
That could work, but you will run into usability issues. I'd say it depends on how many venues you plan to enter into the system, how many languages you are targeting, and, in the end, how keen are your CMS users to pick the right Venue document for every VenueTranslation corresponding to a language. I can see how this will quickly become error prone and cumbersome, but I don't have the numbers.
Regarding the final question, it's not correct nor incorrect: it's just that since the granularity of the translations in Hippo is at the document level and not at the field level, you have to do it this way. Your model makes sense but is not well supported in the CMS. This use case is trivial in a CMS that supports the notion of translatable field.
I am working on an install of AspDotNetStoreFront (version 9.3.1.0). Currently, the company stores their own SKU's from their business system in the provided SKU field. They often use Manufacturer Part Number to store their vendors part number.
Example:
The above example is a variant of a product where we would like to store UPC information.
I searched the AspDotNetStoreFront manuals and could not find a recommended strategy for storing UPC codes. Its easy enough to add a field to the database and bulk import the data, however, an admin needs to be able to maintain them from within the stores user interface.
Is there a way to add a UPC field without modifying core ASPDNSF code and still allow users to maintain it from within the UI? Or do I have to use the SKU or MPN fields?
Update
I do see that there are 5 fields for "ExtensionData" that I could possibly use, but I don't see those fields as editable for Variants in the UI the way ExtensionData is for the Products themselves.
I don't think we have had customers who didn't use sku for their UPC code. In the event that you need to modify the table by adding another column, you can modify the admin to show this.
You should be ab able to edit entityEditProducts.aspx and entityEditProducts.aspx.cs to edit this in the admin area. You will just need to modify the sql scripts and the view.
I'm not sure if it's important enough for you to upgrade over, but version 9.4 added fields for UPC. From the 9.4 release notes (http://partners.vortx.com/t-summer2013releasenotes.aspx):
"Added new GTIN field to the product variant information for unique product identification. This new field holds up to 14 characters and can be used for EAN, UPC, ISBN, etc. This new field is included in WSI, Excel & XML Imports, and supported by DotFeed."
The GTIN field works for both variant and size/color.
you can use one of the 5 extension field given by default in the product table to store UPC code. By default it has also UI in edit product under Extension Data tab.
We currently have a Web Forms set up for our website and are looking to slowly convert this to MVC. Currently we store translations in a database. our translation table contains columns for each language and a sort of title. which we can identify the translation with(The primary key)
But it gets more complex when we actually may have different clients wanting different words for the same bit of text.
E.g. one will want it to read - Delivery Costs
And the next may want it as - Delivery Prices
So we then have a second CustomTranslation datatable which will be the same as the translation but also have a client ID number in it. If the user logged in and it looking for the Identify of the translation as "DeliveryCost" it will check to see if there is a record in the CustomTranslation table it will use that OVER the standard Translation table.
After which it will then pick the appropriate language the users wants.
Basically I need to be able to have our website translate depending on the users settings. And as well as the company they work for (our client)
The general method of localization uses resource files but we need to really keep them in the database. This produces a second problem which is when you try to declare Propertry Display Names and Validation Messages these also need to ability to have different text and/or translations but generally it expects a Static field which we would not have.
Whats the best way to go about solving this complex localization issue?
Thanks in advance. Steve
Problem 1 - Having the resources in the database
Use the approach used in this article for extending the standard resources into the database.
Problem 2 - Having custom localization per customer
No problem, the standard .net approach supports localization including a region or customer, just use i.e. en-US, en-US-Customer1, en-US-Customer2, etc.