Creating a new display format
To create a new display format:
Procedure
Results
Note: You may need to add multiple entries to the LANGUAGEDS and LANGPAIR tables, one for every language that your store supports.
Example of creating a new display format
The following example shows how you could create a display format to view the ConsumerDirect starter store pages in Thai.
- Translate the storetext_locale.properties file to Thai.
- Ensure that the encoding statement in the properties file references a character set that target browsers will support. For Thai the encode statement is as follows: ENCODESTATEMENT = text/html; charset=MS874
- Save the file as storetext_th_TH.properties
- Open a database command window and run the following command:
This command returns the language IDs in use by currently available display formats. Choose the next available ID_VALUE. In this example, the ID_VALUE is for Thai is 3.select * from language
- Run the following command:
Using the following values:insert into language (LANGUAGE_ID, ENCODING, LOCALENAME, LANGUAGE, COUNTRY, MIMECHARSET) values (ID_Value, ENCODING_VALUE, 'w', 'x', 'y', 'z')
insert into language (LANGUAGE_ID, ENCODING, LOCALENAME, LANGUAGE, COUNTRY) values ('3', 'MS874', 'th_TH', 'Thai', 'Thailand','<MIME character>')
- Add an entry to the LANGUAGEDS table with the following values:
Using the following values:insert into languageds (LANGUAGE_ID, DESCRIPTION, LANGUAGE_ID_DESC) values (ID_Value,'x', ID_Desc_Value)
insert into languageds (LANGUAGE_ID, DESCRIPTION, LANGUAGE_ID_DESC) values (-1, 'French', 2)
See, step 2 for more information about the values.
- Create an alternative language for Thai used if the data requested
in Thai does not exist. This is useful if not all the data in the
database is translated into the new language. To create an alternative
language run the following command:
Using the following values:insert into langpair(LANGUAGE_ID, LANGUAGE_ID_ALT, SEQUENCE, STOREENT_ID) values (ID_Value, ID_Value_ALT, 'x', 'y')
whereinsert into langpair(LANGUAGE_ID, LANGUAGE_ID_ALT, SEQUENCE , STOREENT_ID) values ('3','-1', '1' '12345')
- LANGUAGE_ID
- The requested language
- LANGUAGE_ID_ALT
- is the alternative language
- SEQUENCE
- When the requested Language is supported as specified in the STORELANG table, but information is not available in that Language, each alternative Language is tried in ascending order of SEQUENCE. A store may override the SEQUENCE specified for its StoreGroup.
- STOREENT_ID
- The StoreEntity this relationship belongs to The alternative Language relationships for a Store include the alternative Language relationships for its StoreGroup.
The preceding insert statement will assign English (language id = -1) as the first alternative language to try for store with id '12345' in the event that no Thai data is found.
- Convert any properties file from native to ascii: Copy the storetext_th_TH.properties
file to a temporary directory (for example, /tmp). Run the following
command:
Where JDK_dir is the path to your JDKJDK_dir/bin/native2ascii -encoding TIS620 /tmp/storetext_th_TH.properties /tmp/storetext_th_TH_new.properties
Copy the storetext_th_TH_new.properties file from the temporary directory to WC_eardir/Stores.war/WEB-INF/classes/ storeDir/storetext_th_TH.properties.