Package VASSAL.i18n
Class Localization
- All Implemented Interfaces:
AutoConfigurable
,Buildable
,Configurable
,PropertyNameSource
,ValidityChecker
,Translatable
,Auditable
,ImageSearchTarget
,SearchTarget
Singleton class for managing the translation of a module into other languages
- Author:
- rodneykinney
-
Nested Class Summary
Nested classes/interfaces inherited from interface VASSAL.build.AutoConfigurable
AutoConfigurable.Util
-
Field Summary
Modifier and TypeFieldDescriptionprotected String
protected List
<Translation> protected String
protected List
<Translation> protected VassalResourceBundle
protected String
protected List
<Translation> protected Set
<TranslatableAttribute> Record attributes as the module is being built for later translationprotected boolean
protected boolean
protected List
<Translation> Fields inherited from class VASSAL.build.AbstractConfigurable
changeSupport, config, localizedName, myI18nData, name
Fields inherited from class VASSAL.build.AbstractBuildable
buildComponents, validator
Fields inherited from interface VASSAL.build.Configurable
NAME_PROPERTY
-
Method Summary
Modifier and TypeMethodDescriptionprotected void
addBundle
(VassalResourceBundle child) void
Called whenever a Translation is added to a module or extension.static Localization
getTranslation
(String description) Return a specified translationString[]
Return a list of translations available for editing.boolean
Is this component a reqired component within its parent?boolean
boolean
boolean
isUnique()
Does this component need to be unique within it's parent?void
void
saveTranslatableAttribute
(Translatable component, String name, String value) Record an attribute that may need to be translated.void
Translate the module.Translate an individual attribute.Methods inherited from class VASSAL.i18n.Language
addTo, contains, getAllowableConfigureComponents, getAttributeDescriptions, getAttributeNames, getAttributeTypes, getAttributeValueString, getConfigureTypeName, getDescription, getHelpFile, removeFrom, setAttribute
Methods inherited from class VASSAL.build.AbstractConfigurable
add, addPropertyChangeListener, getAttributeVisibility, getConfigureComponents, getConfigureName, getConfigurer, getExpressionList, getFormattedStringList, getI18nData, getI18nPrefix, getLocalizedConfigureName, getMenuTextList, getNamedKeyStrokeList, getPropertyList, getTypeName, remove, removePropertyChangeListener, setAllAttributesUntranslatable, setAttributeTranslatable, setConfigureName
Methods inherited from class VASSAL.build.AbstractBuildable
addImageNamesRecursively, build, buildString, getAllDescendantComponentsOf, getAncestor, getBuildables, getBuildComponents, getBuildElement, getComponents, getComponentsOf, getNonFolderAncestor, getPropertyNames, setAncestor, validate
Methods inherited from class VASSAL.search.AbstractImageFinder
addLocalImageNames, getAllImageNames, getLocalImageNames
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface VASSAL.script.expression.Auditable
getComponentName, getComponentTypeName
Methods inherited from interface VASSAL.build.Buildable
build, getBuildElement, isMovable
-
Field Details
-
moduleBundle
-
languageBundle
-
countryBundle
-
moduleTranslations
-
languageTranslations
-
countryTranslations
-
translations
-
masterBundle
-
translatableItems
Record attributes as the module is being built for later translation -
translationInProgress
protected boolean translationInProgress -
translationComplete
protected boolean translationComplete
-
-
Method Details
-
getInstance
-
getTranslationList
Return a list of translations available for editing.- Returns:
- Array of available translations
-
getTranslation
Return a specified translation- Parameters:
description
- description- Returns:
- Translation object
-
saveTranslatableAttribute
Record an attribute that may need to be translated.- Parameters:
component
- component to be translatedname
- Attribute name to be translatedvalue
- current value of attribute
-
translate
Translate the module. The module and all extensions have now been built, so all Translations are available and all attributes that need to be translated have been recorded. There may be multiple translations that match this Locale, merge them in order - Country overrides Language overrides default. NB - You cannot create a default translation (Module.properties) using the VASSAL editor, but a default file can be placed into a module or extension manually.- Throws:
IOException
- oops
-
translate
-
addBundle
-
isTranslationInProgress
public boolean isTranslationInProgress() -
isTranslationComplete
public boolean isTranslationComplete() -
addTranslation
Called whenever a Translation is added to a module or extension. Check if the translation matches our locale. If so, add it to the list of translations to use. There may multiple matching translations at Country, Language and Module level from different extensions.- Parameters:
t
- Translation
-
removeTranslation
-
isMandatory
public boolean isMandatory()Description copied from interface:Buildable
Is this component a reqired component within its parent?- Specified by:
isMandatory
in interfaceBuildable
- Overrides:
isMandatory
in classLanguage
- Returns:
- true if component is mandatory
-
isUnique
-