git://git.nikiroo.be
/
jvcard.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
a1783d0
)
Fix _NOUTF flag handling in "--i18n"
author
Niki Roo
<niki@nikiroo.be>
Fri, 1 Apr 2016 19:17:56 +0000
(21:17 +0200)
committer
Niki Roo
<niki@nikiroo.be>
Fri, 1 Apr 2016 19:17:56 +0000
(21:17 +0200)
src/be/nikiroo/jvcard/launcher/Main.java
patch
|
blob
|
blame
|
history
src/be/nikiroo/jvcard/resources/Bundles.java
patch
|
blob
|
blame
|
history
src/be/nikiroo/jvcard/resources/bundles/ColorBundle.java
patch
|
blob
|
blame
|
history
src/be/nikiroo/jvcard/resources/bundles/TransBundle.java
patch
|
blob
|
blame
|
history
src/be/nikiroo/jvcard/resources/enums/StringId.java
patch
|
blob
|
blame
|
history
src/be/nikiroo/jvcard/resources/resources.properties
patch
|
blob
|
blame
|
history
src/be/nikiroo/jvcard/resources/resources_en.properties
patch
|
blob
|
blame
|
history
src/be/nikiroo/jvcard/resources/resources_fr.properties
patch
|
blob
|
blame
|
history
diff --git
a/src/be/nikiroo/jvcard/launcher/Main.java
b/src/be/nikiroo/jvcard/launcher/Main.java
index 65fbf9c635f51d4a097ca16604680faabe63c3eb..f193be1b493ae81c09178c1f446ca5563f4ce917 100644
(file)
--- a/
src/be/nikiroo/jvcard/launcher/Main.java
+++ b/
src/be/nikiroo/jvcard/launcher/Main.java
@@
-429,7
+429,7
@@
public class Main {
+ trans(StringId.CLI_HELP_LANG));
System.out.println("\t--tui : " + trans(StringId.CLI_HELP_TUI));
System.out.println("\t--gui : " + trans(StringId.CLI_HELP_GUI));
+ trans(StringId.CLI_HELP_LANG));
System.out.println("\t--tui : " + trans(StringId.CLI_HELP_TUI));
System.out.println("\t--gui : " + trans(StringId.CLI_HELP_GUI));
- System.out.println("\t--noutf : " + trans(StringId.CLI_HELP_NOUTF));
+ System.out.println("\t--noutf : " + trans(StringId.CLI_HELP_NOUTF
_OPTION
));
System.out.println("\t--config : "
+ trans(StringId.CLI_HELP_CONFIG));
System.out.println();
System.out.println("\t--config : "
+ trans(StringId.CLI_HELP_CONFIG));
System.out.println();
diff --git
a/src/be/nikiroo/jvcard/resources/Bundles.java
b/src/be/nikiroo/jvcard/resources/Bundles.java
index b83b1b050d93fa3c56304f90f7138afc2fb28533..ef6e0d750ec2e9b80f518d3f756eab04787e114c 100644
(file)
--- a/
src/be/nikiroo/jvcard/resources/Bundles.java
+++ b/
src/be/nikiroo/jvcard/resources/Bundles.java
@@
-313,11
+313,29
@@
public class Bundles {
* in case of IO error
*/
protected void writeValue(Writer writer, E id) throws IOException {
* in case of IO error
*/
protected void writeValue(Writer writer, E id) throws IOException {
- writer.write(id.name());
+ writeValue(writer, id.name(), getString(id));
+ }
+
+ /**
+ * Write the given data to the config file, i.e.,
+ * "MY_ID = my_curent_value" followed by a new line
+ *
+ * @param writer
+ * the {@link Writer} to write into
+ * @param id
+ * the id to write
+ * @param value
+ * the id's value
+ *
+ * @throws IOException
+ * in case of IO error
+ */
+ protected void writeValue(Writer writer, String id, String value)
+ throws IOException {
+ writer.write(id);
writer.write(" = ");
writer.write(" = ");
- String[] lines = getString(id).replaceAll("\\\t", "\\\\\\t").split(
- "\n");
+ String[] lines = value.replaceAll("\\\t", "\\\\\\t").split("\n");
for (int i = 0; i < lines.length; i++) {
writer.write(lines[i]);
if (i < lines.length - 1) {
for (int i = 0; i < lines.length; i++) {
writer.write(lines[i]);
if (i < lines.length - 1) {
diff --git
a/src/be/nikiroo/jvcard/resources/bundles/ColorBundle.java
b/src/be/nikiroo/jvcard/resources/bundles/ColorBundle.java
index 899ca757fc91f2efcd6cdc36f0aa336e75c7901c..25accfe77c38a1b15761c93aa09c91f7bb2fd25e 100644
(file)
--- a/
src/be/nikiroo/jvcard/resources/bundles/ColorBundle.java
+++ b/
src/be/nikiroo/jvcard/resources/bundles/ColorBundle.java
@@
-26,18
+26,18
@@
public class ColorBundle extends Bundle<ColorOption> {
@Override
protected void writeValue(Writer writer, ColorOption id) throws IOException {
@Override
protected void writeValue(Writer writer, ColorOption id) throws IOException {
-
writer.write(id.name() + "_FG")
;
-
writer.write(" = ")
;
- if (map.containsKey(
id.name() + "_FG"
))
-
writer.write(map.getString(id.name() + "_FG").trim()
);
+
String name = id.name() + "_FG"
;
+
String value = ""
;
+ if (map.containsKey(
name
))
+
value = map.getString(name).trim(
);
- write
r.write("\n"
);
+ write
Value(writer, name, value
);
-
writer.write(id.name() + "_BG")
;
-
writer.write(" = ")
;
- if (map.containsKey(
id.name() + "_BG"
))
-
writer.write(map.getString(id.name() + "_BG").trim()
);
+
name = id.name() + "_BG"
;
+
value = ""
;
+ if (map.containsKey(
name
))
+
value = map.getString(name).trim(
);
- write
r.write("\n"
);
+ write
Value(writer, name, value
);
}
}
}
}
diff --git
a/src/be/nikiroo/jvcard/resources/bundles/TransBundle.java
b/src/be/nikiroo/jvcard/resources/bundles/TransBundle.java
index c79b0b69b62734d7b308ed07a50247fa15b7188e..6ff63bffeb9e3eebd17e6346d06a037d28258f98 100644
(file)
--- a/
src/be/nikiroo/jvcard/resources/bundles/TransBundle.java
+++ b/
src/be/nikiroo/jvcard/resources/bundles/TransBundle.java
@@
-148,6
+148,17
@@
public class TransBundle extends Bundle<StringId> {
StringId.writeHeader(writer, name);
}
StringId.writeHeader(writer, name);
}
+ @Override
+ protected void writeValue(Writer writer, StringId id) throws IOException {
+ super.writeValue(writer, id);
+
+ String name = id.name() + "_NOUTF";
+ if (map.containsKey(name)) {
+ String value = map.getString(name).trim();
+ writeValue(writer, name, value);
+ }
+ }
+
/**
* Return the {@link Locale} representing the given language.
*
/**
* Return the {@link Locale} representing the given language.
*
@@
-180,5
+191,4
@@
public class TransBundle extends Bundle<StringId> {
return locale;
}
return locale;
}
-
}
}
diff --git
a/src/be/nikiroo/jvcard/resources/enums/StringId.java
b/src/be/nikiroo/jvcard/resources/enums/StringId.java
index 0a3d0042fe6fba7b80cc44b382189c8e334fec80..ced8bfc4cf53931737913b7bb04ca74d8a0a5838 100644
(file)
--- a/
src/be/nikiroo/jvcard/resources/enums/StringId.java
+++ b/
src/be/nikiroo/jvcard/resources/enums/StringId.java
@@
-89,7
+89,7
@@
public enum StringId {
@Meta(what = "CLI --help", where = "", format = "", info = "The Help message line for: --")
CLI_HELP_TUI, //
@Meta(what = "CLI --help", where = "", format = "", info = "The Help message line for: --")
@Meta(what = "CLI --help", where = "", format = "", info = "The Help message line for: --")
CLI_HELP_TUI, //
@Meta(what = "CLI --help", where = "", format = "", info = "The Help message line for: --")
- CLI_HELP_NOUTF, //
+ CLI_HELP_NOUTF
_OPTION
, //
@Meta(what = "CLI --help", where = "", format = "", info = "The Help message line for: --")
CLI_HELP_CONFIG, //
@Meta(what = "CLI --help", where = "", format = "", info = "The Help message footer about files and jvcard:// links")
@Meta(what = "CLI --help", where = "", format = "", info = "The Help message line for: --")
CLI_HELP_CONFIG, //
@Meta(what = "CLI --help", where = "", format = "", info = "The Help message footer about files and jvcard:// links")
diff --git
a/src/be/nikiroo/jvcard/resources/resources.properties
b/src/be/nikiroo/jvcard/resources/resources.properties
index 875a1ca0dfd4821d0d494886ae035ebe0075684f..b1783d331bffef6329b368c4aac138d7d030dacc 100644
(file)
--- a/
src/be/nikiroo/jvcard/resources/resources.properties
+++ b/
src/be/nikiroo/jvcard/resources/resources.properties
@@
-46,6
+46,7
@@
KEY_ACTION_SEARCH = Search
# (FORMAT: we could use: ' ', ┃, │...)
# Field separator
DEAULT_FIELD_SEPARATOR = ┃
# (FORMAT: we could use: ' ', ┃, │...)
# Field separator
DEAULT_FIELD_SEPARATOR = ┃
+DEAULT_FIELD_SEPARATOR_NOUTF = |
# (WHAT: Action key, WHERE: ContactDetails)
# Invert the photo's colours
KEY_ACTION_INVERT = Invert colours
# (WHAT: Action key, WHERE: ContactDetails)
# Invert the photo's colours
KEY_ACTION_INVERT = Invert colours
@@
-113,7
+114,7
@@
CLI_HELP_GUI = force the SWING terminal emulator
CLI_HELP_TUI = force text mode (and supports headless JRE)
# (WHAT: CLI --help)
# The Help message line for: --
CLI_HELP_TUI = force text mode (and supports headless JRE)
# (WHAT: CLI --help)
# The Help message line for: --
-CLI_HELP_NOUTF = do not use UTF-8, prefer simple ASCII
+CLI_HELP_NOUTF
_OPTION
= do not use UTF-8, prefer simple ASCII
# (WHAT: CLI --help)
# The Help message line for: --
CLI_HELP_CONFIG = set the configuration directory to DIR
# (WHAT: CLI --help)
# The Help message line for: --
CLI_HELP_CONFIG = set the configuration directory to DIR
diff --git
a/src/be/nikiroo/jvcard/resources/resources_en.properties
b/src/be/nikiroo/jvcard/resources/resources_en.properties
index 7dbc1c4680d750c2c59a0844fcf5d2ddd2235a03..237c898f42ef2bbc0c90096a764b26a3d4abbf9e 100644
(file)
--- a/
src/be/nikiroo/jvcard/resources/resources_en.properties
+++ b/
src/be/nikiroo/jvcard/resources/resources_en.properties
@@
-46,6
+46,7
@@
KEY_ACTION_SEARCH = Search
# (FORMAT: we could use: ' ', ┃, │...)
# Field separator
DEAULT_FIELD_SEPARATOR = ┃
# (FORMAT: we could use: ' ', ┃, │...)
# Field separator
DEAULT_FIELD_SEPARATOR = ┃
+DEAULT_FIELD_SEPARATOR_NOUTF = |
# (WHAT: Action key, WHERE: ContactDetails)
# Invert the photo's colours
KEY_ACTION_INVERT = Invert colours
# (WHAT: Action key, WHERE: ContactDetails)
# Invert the photo's colours
KEY_ACTION_INVERT = Invert colours
@@
-113,7
+114,7
@@
CLI_HELP_GUI = force the SWING terminal emulator
CLI_HELP_TUI = force text mode (and supports headless JRE)
# (WHAT: CLI --help)
# The Help message line for: --
CLI_HELP_TUI = force text mode (and supports headless JRE)
# (WHAT: CLI --help)
# The Help message line for: --
-CLI_HELP_NOUTF = do not use UTF-8, prefer simple ASCII
+CLI_HELP_NOUTF
_OPTION
= do not use UTF-8, prefer simple ASCII
# (WHAT: CLI --help)
# The Help message line for: --
CLI_HELP_CONFIG = set the configuration directory to DIR
# (WHAT: CLI --help)
# The Help message line for: --
CLI_HELP_CONFIG = set the configuration directory to DIR
diff --git
a/src/be/nikiroo/jvcard/resources/resources_fr.properties
b/src/be/nikiroo/jvcard/resources/resources_fr.properties
index f1af0f3f7b9a907d8cd136d71bb1cd56e7c4716a..e14a1fdca694c0b109495f8cdb99c7c394c7b7f2 100644
(file)
--- a/
src/be/nikiroo/jvcard/resources/resources_fr.properties
+++ b/
src/be/nikiroo/jvcard/resources/resources_fr.properties
@@
-46,6
+46,7
@@
KEY_ACTION_SEARCH = Rechercher
# (FORMAT: we could use: ' ', ┃, │...)
# Field separator
DEAULT_FIELD_SEPARATOR = ┃
# (FORMAT: we could use: ' ', ┃, │...)
# Field separator
DEAULT_FIELD_SEPARATOR = ┃
+DEAULT_FIELD_SEPARATOR_NOUTF = |
# (WHAT: Action key, WHERE: ContactDetails)
# Invert the photo's colours
KEY_ACTION_INVERT = Couleurs inversées
# (WHAT: Action key, WHERE: ContactDetails)
# Invert the photo's colours
KEY_ACTION_INVERT = Couleurs inversées
@@
-113,7
+114,7
@@
CLI_HELP_GUI = force l'émulateur de terminal SWING
CLI_HELP_TUI = force le mode texte (et supporte les JRE headless)
# (WHAT: CLI --help)
# The Help message line for: --
CLI_HELP_TUI = force le mode texte (et supporte les JRE headless)
# (WHAT: CLI --help)
# The Help message line for: --
-CLI_HELP_NOUTF = évite l'utilisation de UTF-8, utilise le format ASCII
+CLI_HELP_NOUTF
_OPTION
= évite l'utilisation de UTF-8, utilise le format ASCII
# (WHAT: CLI --help)
# The Help message line for: --
CLI_HELP_CONFIG = cherche les fichiers de configuration dans DIR
# (WHAT: CLI --help)
# The Help message line for: --
CLI_HELP_CONFIG = cherche les fichiers de configuration dans DIR