Now let's modify our first MetaBundle: tutor.meta.Brief.
Please locate
D:\study\av6\tutorials\examples\tutor\meta\Brief.java
(on MS-Windows™)
/home/compl/study/av6/tutorials/examples/tutor/meta/Brief.java
(on Unix like OS)
Brief.meta and
Brief_zh.meta together with it.
Now open
D:\study\av6\tutorials\examples\tutor\meta\Brief.meta
(on MS-Windows™)
/home/compl/study/av6/tutorials/examples/tutor/meta/Brief.meta
(on Unix like OS)
<?xml version="1.0" encoding="UTF-8"?> <java> <tips> <tip title="Tips"> <![CDATA[ In this panel you get tips about how to play with this demo, see other tips under each Tab. <br> Tip tabs here are populated by meta array <code>tips/tip</code> inside MetaBundle file <code>tutor/meta/Brief.meta</code> ]]> </tip> .....
Okay, now replace the green text at above with red text at below: (but DO NOT change other lines in this file!!)
<?xml version="1.0" encoding="UTF-8"?> <java> <tips> <tip title="Tips"> <![CDATA[ In this panel you get tips about how to play with this demo, see other tips under each Tab. <br> I have seen and modified meta array <code>tips/tip</code> inside MetaBundle file <code>tutor/meta/Brief.meta</code> ]]> </tip> .....
After saving this file in your text editor, switch to the Demo App window, it should still look as initially started:
Now press
Of course you can change the tips to any other text, or even add or remove tips, as you like. Feel free to play.
Easy? Okay, let's seek a new challenge now, CREATE a new text file:
D:\study\av6\tutorials\examples\tutor\meta\Brief_fr.meta
(on MS-Windows™)
/home/compl/study/av6/tutorials/examples/tutor/meta/Brief_fr.meta
(on Unix like OS)
(You have to pay particular attention to the file
encoding, the actual format your text editor writes must conform to the one
declared at the first line of the file content.
If you have troubles with file encoding, such as SAXParseExceptions
in the console window, change the file content into plain english and try
again.)
<?xml version="1.0" encoding="UTF-8"?> <java> <tips> <tip title="Bouts"> <![CDATA[ Dans ce panneau que vous obtenez des conseils au sujet de la façon jouer avec cette démo, voir d'autres bouts sous chaque étiquette. ]]> </tip> </tips> </java>Note: The above French text are translated from English at http://babelfish.altavista.com, it might not be exact or even correct.
After saving this file, go to the Demo App window, click to focus in the
ComboBox labeled
fr_FR
and press Enter. On success you should see the window changed
like below:
Here you can see that partial localization is possible with Meta
Facility. Since the brief-demo-note node is missing in Brief_fr.meta,
Brief.meta was further consulted for the text to display as the
bottom note.
Of course neither Meta Facility nor this tutorial would limit your experiments as with French, try your mother language here!
Finally with
D:\study\av6\tutorials\examples\tutor\meta\Brief.meta
(on MS-Windows™)
/home/compl/study/av6/tutorials/examples/tutor/meta/Brief.meta
(on Unix like OS)
localized
metatree at bottom of this file. Try modify the structure and nodes here, save
the file, and press
You may play a while here, when finished, proceed to the next page.