X-Git-Url: http://git.nikiroo.be/?a=blobdiff_plain;f=src%2Fbe%2Fnikiroo%2Futils%2Fresources%2FMetaInfo.java;h=8ec98f9935168b9f0dbe231b1af917e5ce21a316;hb=b5313d03641e21b2abfba01bd9454b89c6050fd0;hp=4722be6f65c1a7328f4c30198eddccf5c5a2b2f8;hpb=74d2a495c7b5c5d66a03dd7f94b58f93849008fb;p=nikiroo-utils.git diff --git a/src/be/nikiroo/utils/resources/MetaInfo.java b/src/be/nikiroo/utils/resources/MetaInfo.java index 4722be6..8ec98f9 100644 --- a/src/be/nikiroo/utils/resources/MetaInfo.java +++ b/src/be/nikiroo/utils/resources/MetaInfo.java @@ -141,7 +141,7 @@ public class MetaInfo> implements Iterable> { /** * The allowed list of values that a {@link Format#FIXED_LIST} item is * allowed to be, or a list of suggestions for {@link Format#COMBO_LIST} - * items. + * items. Also works for {@link Format#LOCALE}. *

* Will always allow an empty string in addition to the rest. * @@ -159,6 +159,22 @@ public class MetaInfo> implements Iterable> { return withEmpty; } + /** + * Return all the languages known by the program for this bundle. + *

+ * This only works for {@link TransBundle}, and will return an empty list if + * this is not a {@link TransBundle}. + * + * @return the known language codes + */ + public List getKnownLanguages() { + if (bundle instanceof TransBundle) { + return ((TransBundle) bundle).getKnownLanguages(); + } + + return new ArrayList(); + } + /** * This item is a comma-separated list of values instead of a single value. *