- writer.append("# " + name + " translation file (UTF-8)\n");
- writer.append("# \n");
- writer.append("# Note that any key can be doubled with a _NOUTF suffix\n");
- writer.append("# to use when the flag --noutf is passed\n");
- writer.append("# \n");
- writer.append("# Also, the comments always refer to the key below them.\n");
- writer.append("# \n");
- writer.append("\n");
-
- for (Field field : StringId.class.getDeclaredFields()) {
- Meta meta = field.getAnnotation(Meta.class);
- if (meta != null) {
- StringId id = StringId.valueOf(field.getName());
- String info = getMetaInfo(meta);
- if (info != null) {
- writer.append(info);
- writer.append("\n");
- }
-
- writer.append(id.name());
- writer.append(" = ");
- if (!trans.trans(id).equals(id.name()))
- writer.append(trans.trans(id));
+ String name = locale.getDisplayCountry(locale);
+ if (name.length() == 0)
+ name = locale.getDisplayLanguage(locale);
+ if (name.length() == 0)
+ name = "default";
+
+ if (code.length() > 0) {
+ name = name + " (" + code + ")";
+ }
+
+ writer.append("# " + name + " translation file (UTF-8)\n");
+ writer.append("# \n");
+ writer.append("# Note that any key can be doubled with a _NOUTF suffix\n");
+ writer.append("# to use when the flag --noutf is passed\n");
+ writer.append("# \n");
+ writer.append("# Also, the comments always refer to the key below them.\n");
+ writer.append("# \n");
+ writer.append("\n");
+
+ for (Field field : StringId.class.getDeclaredFields()) {
+ Meta meta = field.getAnnotation(Meta.class);
+ if (meta != null) {
+ StringId id = StringId.valueOf(field.getName());
+ String info = getMetaInfo(meta);
+ if (info != null) {
+ writer.append(info);