Library XML File
Overview
This page shows how to create and edit a library XML file. This is the first file that Language Mentor looks at when it checks a library for new lessons. It provides information such as the library's name and what kind of lessons the library offers. It doesn't list specific lessons; this is handled by lesson list XML files, which we'll explain next.
Prerequisites
In order to understand the information on this page you should have read and understand the contents of the previous Creating Lessons pages.
First, Create The File
Create a new text file in your main library folder and name it "language_mentor_library.xml", like this:
Next, open the file, copy this template XML into it, then save it.
The contentProviderId Element
Put your content provider ID in the contentProviderId element.
The libraryId Element
Just as every content provider and every lesson has a unique ID, each library also has a unique ID.
We suggest that you create this ID by doing the following:
- Start with your content provider ID
- Append a dot and some sort of descriptor to it.
For example, in the example above we've added ".english" to the content provider ID. This indicates that this is a library that contains English lessons.
We suggest that you consider using a naming convention that corresponds to the naming convention that you're using to name your library folder(s).
The languages And language Elements
The languages element is designed to contain one or more language elements. Each language element provides information about your library in one language. In the example above we're providing an English language name for our organization and an English language name for the library.
This format is designed to support a "user selectable UI language" feature which doesn't exist yet. We hope to add this feature to Language Mentor at some point in the future. At present our UI only supports English. So, while in the future you may want to provide multiple languageelements here, for now you only need to provide one. Here's how:
- Put "eng" into the iso639_3Code element.
- Put your name or your organization's name into the contentProviderName element.
- Put the library's name in the libraryName element.
How is this "name" information different from the IDs that we provide? Simple. Names are intended to be read by Language Mentor's users. IDs are intended to be read by the Language Mentor software, but aren't shown to users.
Should this information be in English? It's up to you. Think about your users. What will be most helpful to them?
Then what, you may ask, does the "eng" code indicate?
In a strict sense, it simply tells Language Mentor "this is the information that you should show the user when your UI is displaying English". But, for the present, Language Mentor's UI always displays English. So, for the present, this information is telling Language Mentor what names it should show the user (at all times). We realize that this may seem a bit silly, but we need to use this format now in order to support multiple UI languages in the future.
The libraryContentInfo Element
The libraryContentInfo Element contains two sub-elements - singleLanguageLessonInfo and dualLanguageLessonInfo.
You should include the singleLanguageLessonInfo element if you're publishing single-language lessons. If you're not, delete it.
The same principle applies to the dualLanguageLessonInfo element - if you're providing dual-language lessons, keep it. If not, delete it.
The singleLanguageLessonInfo Element
If you're providing single-language lessons, simply put the ISO 639-3 code for your library's target language into the single language element, as shown above.
The dualLanguageLessonInfo Element
If you're providing dual-language lessons, you should provide one languagePairs sub-element for each native language that you are supporting.
Within each languagePairs element put the ISO 639-3 code for your library's target language into the targetLanguage element, and the codes for the native languages that you are supporting into the nativeLanguage elements.
For example, this XML indicates that a library provides lessons with a target language of English and a native language of Mandarin Chinese.
This XML indicates that the library also provides English lessons with native language content in Spanish.
The libraryContentInfo Element & Your Library's Subfolders
The content of the libraryContentInfo element should correspond to the subfolders that your library contains. Both are based on what kinds of lessons you are offering - i.e. on what their target languages are, whether they include native language content and, if so, what language or languages the native language content consists of.
In fact, it's the libraryContentInfo element that tells Language Mentor that the subfolders exist. If you don't get this right, Language Mentor won't "see" the folders.
In order to clearly understand how these should correspond you may want to review the explanations above in conjunction with the explanation of library subfolders on the Library Folder Setup page.
Questions?
If you have questions about the lesson creation process, please contact us on our Creating Lessons forum. We're here to help.
What's Next?
We'll show you how to assemble lessons and copy them into library subfolders.