• No results found

The 'Master Language' and 'Custom Master Language' Back to Top

In document Manual vBulletin Version 4.1.4 (Page 92-97)

Phrase Syntax

Back to Top

Showing Avatars {1} to {2} of {3}

Showing Avatars 10 to 20 of 24

24 Avatars Total. Displaying 10 – 20.

{3} Avatars Total. Displaying {1} – {2}.

Using Phrases in Templates

Back to Top

that group. For example, the Polls group is only loaded in poll.php, so if you try to reference poll_timeout in a template that’s loaded on another page, you won’t get any output.

Note:

Some of the following is fairly complex and technical. If you do not wish to add phrases to your templates, then this section does not apply to you.

To reference a simple phrase, you need to place $vbphrase[variable_name] into the appropriate template, replacing variable_name with the appropriate variable name.

If the phrase contains variable portions ({1}, {2}, etc), then you will need to use the <phrase>tag. The general syntax for the <phrase> tag is:

z variable_name represents the variable name of the phrase; this part is the same as with simple phrases.

z argument_list represents a list of variables or text that are used to populate variable sections of the phrase. Each argument is in the form of #="value", where # starts at 1 and increases.

For example, the FORUMDISPLAY template contains:

This will populate showing_threads_x_to_y_of_z with the values of $limitlower ({1}), $limitupper ({2}), and $totalthreads ({3}) similar to the showing_avatars_x_to_y_of_z example in the Phrase Syntax section.

To manage your languages, go to Languages & Phrases > Language Manager in the admin control panel. You will be presented with this:

Here you can add or edit existing languages, change the default language, view a language quick reference, or rebuild all languages.

To reach this page, visit Languages & Phrases > Language Manager > click [Add New Language] or [Edit Settings].

<phrase argument_list>$vbphrase[variable_name]</phrase>

<phrase 1="$limitlower" 2="$limitupper"3="$totalthreads">$vbphrase[showing threads x to y o

Managing Languages

Back to Top

Adding or Editing a Language

Back to Top

The form to add or edit a language contains many settings that are specific to a locale. For example, some people might prefer the mm/dd/yy date format, while others prefer dd/mm/yy.

General Settings

z Title – the name of your language. This will be displayed to users when they are selecting a language.

z Allow User Selection – determines whether users can select the language. If this is set to no, the language is effectively disabled.

z Text Direction – direction of the text in the language. English is left to right, while Hebrew is right to left.

z Language Code – the abbreviation for the language. This will not have any effect on the displayed text, but it may be used by programs such as screen readers.

z HTML Character Set – this indicates the encoding of the characters that are displayed on the page.

Setting this to an incorrect value may prevent some characters from being displayed. If you are unsure what to put here, enter UTF-8, as it will likely contain the characters you need.

z Image Folder Override – this allows you to specify the path to button images, relative to the main forum directory, that contains translated text. This will replace the button images folder, which defaults to images/buttons. If you wish to specify a specific button directory for each style, you may use <#>. At runtime, this will be replaced with the ID number of the style that the user is using.

Date / Time Formatting

This section allows you to specify specific date and time options. Locale represents a special code that allows dates and times to be automatically translated into a specific language. All the other settings in this group allow you to override the default date and time formatting with one that is more appropriate for your language. For example, English (US) would use the mm/dd/yy format, while English (UK) would use the dd/mm/yy format.

These formats are represented by %m/%d/%y and %d/%m/%y, respectively.

Number Formatting

z Decimal Separator – represents the character that separates the integer and decimal parts of a number.

z Thousands Separator – represents the character that separates and groups thousands in a number.

To begin translating a language, clickLanguages & Phrases > Language Manager > click [Edit / Translate <language name>

Phrases]. This will take you to a page that looks like this:

This page contains a list of phrases for the language. On the left is the phrase’s variable name; on the right are the default value (top) and the translated value (bottom). If a phrase has not been translated yet, the default value will be in the bottom as well.

Once you have translated a page, simply click [Save]. Any phrases which have changed will be saved and used in this language. To do a complete translation, repeat this process for each page of every phrase group.

The language quick reference can be reached by going to Languages & Phrases > Language Manager > click [View QuickRef]. This will popup a window like this:

On the left, you will see a list of phrase variable names. Once you click one, the code to use in a template will appear on the right, along with the phrase’s text.

At the bottom, you can change the language and phrase group being viewed.

Rebuilding all languages can be accomplished by going to Languages & Phrases > Language Manager > click [Rebuild All Languages]. This option will regenerate all cached language data. Generally, this is not necessary. However, if you have edited the language information in the database directly, you will need to run this setting for your changes to take effect.

Note:

Running this option, even when unnecessary, will not harm your forum.

The phrase manager is generally just another interface for doing translations. Data is just grouped by phrase instead of by language.

Clicking Languages & Phrases > Phrase Manager will lead you to a page that looks like this:

Translating a Language

Back to Top

Language Quick Reference

Back to Top

Rebuilding All Languages

Back to Top

Managing Phrases

Back to Top

Phrases that are checked have a translation in that language; unchecked, empty circles are using the default value.

From here, you can add or edit and search for orphaned phrases.

Adding a phrase is straight forward.

z Phrase Type – the type (or group) that this phrase will be put it. It will only be loaded by pages that load that group.

z Varname – the variable name of the phrase that will be used to identify the phrase in code. You may only use a-z, A-Z, 0-9, and _ in the name.

z Text – the default text of the phrase. You may use {1}, {2}, etc to represent variable parts of a phrase.

Note:

When editing a phrase, the options listed above may not be available. You will have to delete and recreate the phrase and translations to change these values.

Below this is a text area for each language on the board. Here you may create any translations necessary; if you leave the box blank, the value from the Text box will be used. You may specify a translation at any point.

Note:

To delete a translation, simply remove the text in the translation box.

Adding or Editing a Phrase

Back to Top

Orphan Phrases

Back to Top

Orphan phrases are phrases that exist in the database but don’t have a default value in the Master Language or the Custom Master Language. This is most commonly caused by phrases becoming obsolete and being removed by an upgrade. In most cases, these phrases will no longer be used, but if you need to edit or delete these phrases, you should search for orphan phrases.

When you search for orphan phrases, you will see a screen like this:

Note:

If you do not have any orphaned phrases, you will see a message stating this.

You may Keep the phrase, which will allow you to designate a translation as the default version to be moved into the Custom Master Language, or Delete the phrase, which remove all translations of it from the database.

The phrase search page (Languages & Phrases > Search in Phrases) allows you to search through the phrases used in all languages.

z Search for Text – the text used to do the search. It will search for this string exactly; what comes before and after it does not matter. Therefore, a search for I will return every phrase with an I in it, not just those with the word I.

z Search in ... – allows you to select where to search. In most cases, Phrase Text Only will be the most useful option.

z Case-Sensitive – allows you to choose whether the search is case sensitive.

Languages can be downloaded (exported) and uploaded (imported) like styles. This allows you to share your translations with others or use someone else’s translation to save time. To upload or download a language, go to Languages & Phrases > Download / Upload Languages.

To download a language, simply select it and an appropriate filename and click [Download].

Note:

Only translated phrases will be in a downloaded language.

z Language Source – the first two options represent the source of the language, a file you upload or a file that is already on the server. If you do not specify a file to upload, it will assume that you are importing the file off the server.

z Overwrite Language – if you select a language here, that language will be overwritten with the uploaded language. Otherwise, a new language will be created. This is useful if you are importing a newer version of an existing language.

z Title for Uploaded Language – if you are creating a new language, you may specify a title for it here. You may leave this option blank to use the title in the language file.

z Ignore Language Version – if you leave this at no, then an error message will be displayed and the language will not be imported if it was created for a different version of vBulletin. Set this to yes to disable this error checking.

Warning:

Language data generally changes from version to version. Thus, if you are importing a language from an older version, these differences may cause problems.

Languages are downloaded in XML. The XML for a language contains a <language> tag that provides information about the language, multiple <phrasetype> tags that denote each phrase type/group, and many

<phrase> tags that describe the individual phrases.

Note:

The <phrase> tags here are very different from the <phrase> tags used in templates.

An example language XML file looks like this:

Search in Phrases

Back to Top

In document Manual vBulletin Version 4.1.4 (Page 92-97)