How to development multi language application in spring? - spring-boot

I want to development multi language application. but I can't find detail information ve documents. How to get rows of current language data? When the user language changes, I want the data suitable for that language to come.
database model I'm considering
News
id
image
created_at
updated_at
NewsTranslation
id
title
description
locale
created_at
updated_at

Related

Change report locale for each record?

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.

Where do you store UPC codes for products?

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.

created_at column is taking junk date in magento when editing the customer

I’m using Magento 1.6.1CE.
I have set the default time zone to Australia/Perth. my server also running in the same time Zone.
when creating the customer there is no issue with created_at column in DB and Customer Since column in admin html.
But when edit the details and Update no problem in saving but Customer Since column is taking some junk date like 30/11/00-1 1:30:00 AM or 01/01/1970 9:30:00 AM. so I’m unable to edit it next time(showing Exception handling is disabled)
when I see in the DB created_at it is showing 0000-00-00 00:00:00.
Please let me know how can I solve this problem. I’m new to Magento Coding.
Thanks in Advance…
I had similar issue once. It's because Magento assumes a specific date format, which depends on your locale.
By default Magento uses format Month/Day/Year. In your case it seems like Magento acutally shifts Day and Month. So, make sure that "Locale" and "Timezone" in System > Configuration > General > Locale Options match.
If they match and you still get this issue, then you will can try to rewrite customer edit block or a controller action.

Changing updated_at in a Rails record

I have a memory based session table containing the following:
id
sessnhash
userid
created_at
updated_at
The idea is that when a user first logs in a random sessnhash is created and passed back so that all further actions have to send that sessionhash for server requests. These go through a loggedin? method on the application controller which simply checks that a row in the table exists for that sessionhash.
I now want to extend this functionality to keep a tab of the last time any activity happened for that user and I thought one of way of doing this would be to immediately do a save after finding the sessionhash, hoping that this would then update the 'updated_at' attribute.
However Rails is too clever and doesn't update anything as in reality nothing has been updated.
Is there any way of forcing Rails to update the updated_at attribute without having to make any data changes to any of the other attributes?
I've just learnt that I need to do.
sessn.touch
which will update the updated_at attribute.
It's all in here: touch.

Magento product name as text instead of varchar

How could I alter the product name attribute so it's text instead of varchar? Is there a way of doing this through Magento?
I'm currently migrating an old database and the product names are much longer than varchar can fit.
Thanks!
I'm not a Magento expert yet, but out of a common knowledge of E-Commerce systems, I'm not sure this is a good idea. The product name is being used in numerous places around the system (e.g. in reports; in confirmation E-Mails ....) that would all have to be checked for limitations and breaking layouts.
Would it not be conceivable to either
Put the long name into a description field that already is of the type TEXT, and put a cut-off version into the name field
Put the long name into a description field, and alter any needed layouts so that description field is shown in place of the product name?

Resources