From 5bc9573be46f09ac92207e104915bd5babbd6d63 Mon Sep 17 00:00:00 2001 From: Niki Roo Date: Mon, 25 Mar 2019 22:17:36 +0100 Subject: [PATCH] gui: French translation --- TODO.md | 2 +- changelog-fr.md | 4 + changelog.md | 4 + src/be/nikiroo/fanfix/Instance.java | 20 +- .../fanfix/bundles/StringIdBundle.java | 6 +- .../nikiroo/fanfix/bundles/StringIdGui.java | 195 ++++++++++++++++++ .../fanfix/bundles/StringIdGuiBundle.java | 40 ++++ src/be/nikiroo/fanfix/bundles/Target.java | 6 +- .../fanfix/bundles/resources_gui.properties | 190 +++++++++++++++++ .../bundles/resources_gui_fr.properties | 190 +++++++++++++++++ .../nikiroo/fanfix/reader/ui/GuiReader.java | 23 ++- .../fanfix/reader/ui/GuiReaderBookInfo.java | 126 ++++++++++- .../fanfix/reader/ui/GuiReaderFrame.java | 118 +++++++---- .../fanfix/reader/ui/GuiReaderGroup.java | 3 +- .../fanfix/reader/ui/GuiReaderMainPanel.java | 55 ++--- .../reader/ui/GuiReaderPropertiesFrame.java | 4 +- .../fanfix/reader/ui/GuiReaderViewer.java | 16 +- .../reader/ui/GuiReaderViewerPanel.java | 5 +- 18 files changed, 909 insertions(+), 98 deletions(-) create mode 100644 src/be/nikiroo/fanfix/bundles/StringIdGui.java create mode 100644 src/be/nikiroo/fanfix/bundles/StringIdGuiBundle.java create mode 100644 src/be/nikiroo/fanfix/bundles/resources_gui.properties create mode 100644 src/be/nikiroo/fanfix/bundles/resources_gui_fr.properties diff --git a/TODO.md b/TODO.md index 4cb57626..5b3110b4 100644 --- a/TODO.md +++ b/TODO.md @@ -66,7 +66,7 @@ My current planning for Fanfix (but not everything appears on this list): - [x] Make use of it in gui - [ ] Make use of it in tui - [ ] Use it for all user output - - [ ] French translation + - [x] French translation - [x] French manual/readme - [x] Install a mechanism to handle stories import/export progress update - [x] Progress system diff --git a/changelog-fr.md b/changelog-fr.md index 71815d38..dcabaeec 100644 --- a/changelog-fr.md +++ b/changelog-fr.md @@ -1,5 +1,9 @@ # Fanfix +# Version WIP + +- gui: traduction en français + # Version 2.0.1 - lib: un changement de titre/source/author n'était pas toujours visible en runtime diff --git a/changelog.md b/changelog.md index 11cdacec..e6b2af1f 100644 --- a/changelog.md +++ b/changelog.md @@ -1,5 +1,9 @@ # Fanfix +# Version WIP + +- gui: translated into French + # Version 2.0.1 - lib: a change of title/source/author was not always visible at runtime diff --git a/src/be/nikiroo/fanfix/Instance.java b/src/be/nikiroo/fanfix/Instance.java index ece87186..b4af5e83 100644 --- a/src/be/nikiroo/fanfix/Instance.java +++ b/src/be/nikiroo/fanfix/Instance.java @@ -8,6 +8,7 @@ import be.nikiroo.fanfix.bundles.Config; import be.nikiroo.fanfix.bundles.ConfigBundle; import be.nikiroo.fanfix.bundles.StringId; import be.nikiroo.fanfix.bundles.StringIdBundle; +import be.nikiroo.fanfix.bundles.StringIdGuiBundle; import be.nikiroo.fanfix.bundles.UiConfig; import be.nikiroo.fanfix.bundles.UiConfigBundle; import be.nikiroo.fanfix.library.BasicLibrary; @@ -30,6 +31,7 @@ public class Instance { private static UiConfigBundle uiconfig; private static StringIdBundle trans; private static DataLoader cache; + private static StringIdGuiBundle transGui; private static BasicLibrary lib; private static File coverDir; private static File readerTmp; @@ -200,6 +202,8 @@ public class Instance { /** * Get the (unique) {link StringIdBundle} for the program. + *

+ * This is used for the translations of the core parts of Fanfix. * * @return the {link StringIdBundle} */ @@ -207,6 +211,17 @@ public class Instance { return trans; } + /** + * Get the (unique) {link StringIdGuiBundle} for the program. + *

+ * This is used for the translations of the GUI parts of Fanfix. + * + * @return the {link StringIdGuiBundle} + */ + public static StringIdGuiBundle getTransGui() { + return transGui; + } + /** * Get the (unique) {@link LocalLibrary} for the program. * @@ -350,7 +365,8 @@ public class Instance { /** * Create the config variables ({@link Instance#config}, - * {@link Instance#uiconfig} and {@link Instance#trans}). + * {@link Instance#uiconfig}, {@link Instance#trans} and + * {@link Instance#transGui}). * * @param configDir * the directory where to find the configuration files @@ -380,6 +396,7 @@ public class Instance { // No updateFile for this one! (we do not want the user to have custom // translations that won't accept updates from newer versions) trans = new StringIdBundle(getLang()); + transGui = new StringIdGuiBundle(getLang()); // Fix an old bug (we used to store custom translation files by // default): @@ -389,6 +406,7 @@ public class Instance { if (checkEnv("NOUTF")) { trans.setUnicode(false); + transGui.setUnicode(false); } Bundles.setDirectory(configDir); diff --git a/src/be/nikiroo/fanfix/bundles/StringIdBundle.java b/src/be/nikiroo/fanfix/bundles/StringIdBundle.java index e94c05b4..b9a0d797 100644 --- a/src/be/nikiroo/fanfix/bundles/StringIdBundle.java +++ b/src/be/nikiroo/fanfix/bundles/StringIdBundle.java @@ -6,20 +6,20 @@ import java.io.IOException; import be.nikiroo.utils.resources.TransBundle; /** - * This class manages the translation resources of the application. + * This class manages the translation resources of the application (Core). * * @author niki */ public class StringIdBundle extends TransBundle { /** * Create a translation service for the given language (will fall back to - * the default one i not found). + * the default one if not found). * * @param lang * the language to use */ public StringIdBundle(String lang) { - super(StringId.class, Target.resources, lang); + super(StringId.class, Target.resources_core, lang); } /** diff --git a/src/be/nikiroo/fanfix/bundles/StringIdGui.java b/src/be/nikiroo/fanfix/bundles/StringIdGui.java new file mode 100644 index 00000000..705eef48 --- /dev/null +++ b/src/be/nikiroo/fanfix/bundles/StringIdGui.java @@ -0,0 +1,195 @@ +package be.nikiroo.fanfix.bundles; + +import java.io.IOException; +import java.io.Writer; + +import be.nikiroo.utils.resources.Bundle; +import be.nikiroo.utils.resources.Meta; +import be.nikiroo.utils.resources.Meta.Format; + +/** + * The {@link Enum} representing textual information to be translated to the + * user as a key. + * + * Note that each key that should be translated must be annotated with a + * {@link Meta} annotation. + * + * @author niki + */ +@SuppressWarnings("javadoc") +public enum StringIdGui { + /** + * A special key used for technical reasons only, without annotations so it + * is not visible in .properties files. + *

+ * Use it when you need NO translation. + */ + NULL, // + /** + * A special key used for technical reasons only, without annotations so it + * is not visible in .properties files. + *

+ * Use it when you need a real translation but still don't have a key. + */ + DUMMY, // + @Meta(def = "Fanfix %s local library", format = Format.STRING, description = "the title of the main window of Fanfix, the library", info = "%s = current Fanfix version") + // The titles/subtitles: + TITLE_LIBRARY, // + @Meta(def = "Fanfix %s on %s", format = Format.STRING, description = "the title of the main window of Fanfix, the library, when the library has a name (i.e., is not local)", info = "%s = current Fanfix version, %s = library name") + TITLE_LIBRARY_WITH_NAME, // + @Meta(def = "Fanfix Configuration", format = Format.STRING, description = "the title of the configuration window of Fanfix, also the name of the menu button") + TITLE_CONFIG, // + @Meta(def = "This is where you configure the options of the program.", format = Format.STRING, description = "the subtitle of the configuration window of Fanfix") + SUBTITLE_CONFIG, // + @Meta(def = "UI Configuration", format = Format.STRING, description = "the title of the UI configuration window of Fanfix, also the name of the menu button") + TITLE_CONFIG_UI, // + @Meta(def = "This is where you configure the graphical appearence of the program.", format = Format.STRING, description = "the subtitle of the UI configuration window of Fanfix") + SUBTITLE_CONFIG_UI, // + @Meta(def = "Save", format = Format.STRING, description = "the title of the 'save to/export to' window of Fanfix") + TITLE_SAVE, // + @Meta(def = "Moving story", format = Format.STRING, description = "the title of the 'move to' window of Fanfix") + TITLE_MOVE_TO, // + @Meta(def = "Move to:", format = Format.STRING, description = "the subtitle of the 'move to' window of Fanfix") + SUBTITLE_MOVE_TO, // + @Meta(def = "Delete story", format = Format.STRING, description = "the title of the 'delete' window of Fanfix") + TITLE_DELETE, // + @Meta(def = "Delete %s: %s", format = Format.STRING, description = "the subtitle of the 'delete' window of Fanfix", info = "%s = LUID of the story, %s = title of the story") + SUBTITLE_DELETE, // + @Meta(def = "Library error", format = Format.STRING, description = "the title of the 'library error' dialogue") + TITLE_ERROR_LIBRARY, // + @Meta(def = "Importing from URL", format = Format.STRING, description = "the title of the 'import URL' dialogue") + TITLE_IMPORT_URL, // + @Meta(def = "URL of the story to import:", format = Format.STRING, description = "the subtitle of the 'import URL' dialogue") + SUBTITLE_IMPORT_URL, // + @Meta(def = "Error", format = Format.STRING, description = "the title of general error dialogues") + TITLE_ERROR, // + @Meta(def = "%s: %s", format = Format.STRING, description = "the title of a story for the properties dialogue, the viewers...", info = "%s = LUID of the story, %s = title of the story") + TITLE_STORY, // + + // + + @Meta(def = "A new version of the program is available at %s", format = Format.STRING, description = "HTML text used to notify of a new version", info = "%s = url link in HTML") + NEW_VERSION_AVAILABLE, // + @Meta(def = "Updates available", format = Format.STRING, description = "text used as title for the update dialogue") + NEW_VERSION_TITLE, // + @Meta(def = "Version %s", format = Format.STRING, description = "HTML text used to specify a newer version title and number, used for each version newer than the current one", info = "%s = the newer version number") + NEW_VERSION_VERSION, // + @Meta(def = "%s words", format = Format.STRING, description = "show the number of words of a book", info = "%s = the number") + BOOK_COUNT_WORDS, // + @Meta(def = "%s images", format = Format.STRING, description = "show the number of images of a book", info = "%s = the number") + BOOK_COUNT_IMAGES, // + @Meta(def = "%s stories", format = Format.STRING, description = "show the number of stories of a meta-book (a book representing allthe types/sources or all the authors present)", info = "%s = the number") + BOOK_COUNT_STORIES, // + + // Menu (and popup) items: + + @Meta(def = "File", format = Format.STRING, description = "the file menu") + MENU_FILE, // + @Meta(def = "Exit", format = Format.STRING, description = "the file/exit menu button") + MENU_FILE_EXIT, // + @Meta(def = "Import File...", format = Format.STRING, description = "the file/import_file menu button") + MENU_FILE_IMPORT_FILE, // + @Meta(def = "Import URL...", format = Format.STRING, description = "the file/import_url menu button") + MENU_FILE_IMPORT_URL, // + @Meta(def = "Save as...", format = Format.STRING, description = "the file/export menu button") + MENU_FILE_EXPORT, // + @Meta(def = "Move to", format = Format.STRING, description = "the file/move to menu button") + MENU_FILE_MOVE_TO, // + @Meta(def = "Set author", format = Format.STRING, description = "the file/set author menu button") + MENU_FILE_SET_AUTHOR, // + @Meta(def = "New source...", format = Format.STRING, description = "the file/move to/new type-source menu button, that will trigger a dialogue to create a new type/source") + MENU_FILE_MOVE_TO_NEW_TYPE, // + @Meta(def = "New author...", format = Format.STRING, description = "the file/move to/new author menu button, that will trigger a dialogue to create a new author") + MENU_FILE_MOVE_TO_NEW_AUTHOR, // + @Meta(def = "Rename...", format = Format.STRING, description = "the file/rename menu item, that will trigger a dialogue to ask for a new title for the story") + MENU_FILE_RENAME, // + @Meta(def = "Properties", format = Format.STRING, description = "the file/Properties menu item, that will trigger a dialogue to show the properties of the story") + MENU_FILE_PROPERTIES, // + @Meta(def = "Open", format = Format.STRING, description = "the file/open menu item, that will open the story or fake-story (an author or a source/type)") + MENU_FILE_OPEN, // + @Meta(def = "Edit", format = Format.STRING, description = "the edit menu") + MENU_EDIT, // + @Meta(def = "Clear cache", format = Format.STRING, description = "the clear cache menu button, to clear the cache for a single book") + MENU_EDIT_CLEAR_CACHE, // + @Meta(def = "Redownload", format = Format.STRING, description = "the edit/redownload menu button, to download the latest version of the book") + MENU_EDIT_REDOWNLOAD, // + @Meta(def = "Delete", format = Format.STRING, description = "the edit/delete menu button") + MENU_EDIT_DELETE, // + @Meta(def = "Set as cover for source", format = Format.STRING, description = "the edit/Set as cover for source menu button") + MENU_EDIT_SET_COVER_FOR_SOURCE, // + @Meta(def = "Set as cover for author", format = Format.STRING, description = "the edit/Set as cover for author menu button") + MENU_EDIT_SET_COVER_FOR_AUTHOR, // + @Meta(def = "View", format = Format.STRING, description = "the view menu") + MENU_VIEW, // + @Meta(def = "Word count", format = Format.STRING, description = "the view/word_count menu button, to show the word/image/story count as secondary info") + MENU_VIEW_WCOUNT, // + @Meta(def = "Author", format = Format.STRING, description = "the view/author menu button, to show the author as secondary info") + MENU_VIEW_AUTHOR, // + @Meta(def = "Sources", format = Format.STRING, description = "the sources menu, to select the books from a specific source; also used as a title for the source books") + MENU_SOURCES, // + @Meta(def = "Authors", format = Format.STRING, description = "the authors menu, to select the books of a specific author; also used as a title for the author books") + MENU_AUTHORS, // + @Meta(def = "Options", format = Format.STRING, description = "the options menu, to configure Fanfix from the GUI") + MENU_OPTIONS, // + @Meta(def = "All", format = Format.STRING, description = "a special menu button to select all the sources/types or authors, by group (one book = one group)") + MENU_XXX_ALL_GROUPED, // + @Meta(def = "Listing", format = Format.STRING, description = "a special menu button to select all the sources/types or authors, in a listing (all the included books are listed, grouped by source/type or author)") + MENU_XXX_ALL_LISTING, // + @Meta(def = "[unknown]", format = Format.STRING, description = "a special menu button to select the books without author") + MENU_AUTHORS_UNKNOWN, // + + // Progress names + @Meta(def = "Removing old copy", format = Format.STRING, description = "progress bar caption for the 'removing old copy' step of 'redownload'") + PROGRESS_REDOWNLOAD_REMOVE_OLD_COPY, // + @Meta(def = "Reload books", format = Format.STRING, description = "progress bar caption for the 'reload books' step of all outOfUi operations") + PROGRESS_OUT_OF_UI_RELOAD_BOOKS, // + + // Error messages + @Meta(def = "An error occured when contacting the library", format = Format.STRING, description = "default description if the error is not known") + ERROR_LIB_STATUS, // + @Meta(def = "You are not allowed to access this library", format = Format.STRING, description = "library access not allowed") + ERROR_LIB_STATUS_UNAUTORIZED, // + @Meta(def = "Library not valid", format = Format.STRING, description = "the library is invalid (not correctly set up)") + ERROR_LIB_STATUS_INVALID, // + @Meta(def = "Library currently unavailable", format = Format.STRING, description = "the library is out of commission") + ERROR_LIB_STATUS_UNAVAILABLE, // + @Meta(def = "Cannot open the selected book", format = Format.STRING, description = "cannot open the book, internal or external viewer") + ERROR_CANNOT_OPEN, // + @Meta(def = "URL not supported: %s", format = Format.STRING, description = "URL is not supported by Fanfix", info = "%s = URL") + ERROR_URL_NOT_SUPPORTED, // + @Meta(def = "Failed to import %s:\n%s", format = Format.STRING, description = "cannot import the URL", info = "%s = URL, %s = reasons") + ERROR_URL_IMPORT_FAILED, + + // Others + @Meta(def = "  Chapter

%d

/%d", format = Format.STRING, description = "(html) the chapter progression value used on the viewers", info = "%d = chapter number, %d = total chapters") + CHAPTER_HTML_UNNAMED, // + @Meta(def = "  Chapter

%d

/%d
: %s", format = Format.STRING, description = "(html) the chapter progression value used on the viewers", info = "%d = chapter number, %d = total chapters, %s = chapter name") + CHAPTER_HTML_NAMED, // + @Meta(def = "Image

%d

/%d", format = Format.STRING, description = "(html) the chapter progression value used on the viewers", info = "%d = currnt image number, %d = total images") + IMAGE_PROGRESSION, // + + ; + + /** + * Write the header found in the configuration .properties file of + * this {@link Bundle}. + * + * @param writer + * the {@link Writer} to write the header in + * @param name + * the file name + * + * @throws IOException + * in case of IO error + */ + static public void writeHeader(Writer writer, String name) + throws IOException { + writer.write("# " + name + " translation file (UTF-8)\n"); + writer.write("# \n"); + writer.write("# Note that any key can be doubled with a _NOUTF suffix\n"); + writer.write("# to use when the NOUTF env variable is set to 1\n"); + writer.write("# \n"); + writer.write("# Also, the comments always refer to the key below them.\n"); + writer.write("# \n"); + } +} diff --git a/src/be/nikiroo/fanfix/bundles/StringIdGuiBundle.java b/src/be/nikiroo/fanfix/bundles/StringIdGuiBundle.java new file mode 100644 index 00000000..c036381b --- /dev/null +++ b/src/be/nikiroo/fanfix/bundles/StringIdGuiBundle.java @@ -0,0 +1,40 @@ +package be.nikiroo.fanfix.bundles; + +import java.io.File; +import java.io.IOException; + +import be.nikiroo.utils.resources.TransBundle; + +/** + * This class manages the translation resources of the application (GUI). + * + * @author niki + */ +public class StringIdGuiBundle extends TransBundle { + /** + * Create a translation service for the given language (will fall back to + * the default one if not found). + * + * @param lang + * the language to use + */ + public StringIdGuiBundle(String lang) { + super(StringIdGui.class, Target.resources_gui, lang); + } + + /** + * Update resource file. + * + * @param args + * not used + * + * @throws IOException + * in case of I/O error + */ + public static void main(String[] args) throws IOException { + String path = new File(".").getAbsolutePath() + + "/src/be/nikiroo/fanfix/bundles/"; + new StringIdGuiBundle(null).updateFile(path); + System.out.println("Path updated: " + path); + } +} diff --git a/src/be/nikiroo/fanfix/bundles/Target.java b/src/be/nikiroo/fanfix/bundles/Target.java index 8b5e867f..b530c076 100644 --- a/src/be/nikiroo/fanfix/bundles/Target.java +++ b/src/be/nikiroo/fanfix/bundles/Target.java @@ -14,8 +14,10 @@ public enum Target { * .properties file */ config, - /** Translation resources */ - resources, + /** Translation resources (Core) */ + resources_core, + /** Translation resources (GUI) */ + resources_gui, /** UI resources (from colours to behaviour) */ ui, /** Description of UI resources. */ diff --git a/src/be/nikiroo/fanfix/bundles/resources_gui.properties b/src/be/nikiroo/fanfix/bundles/resources_gui.properties new file mode 100644 index 00000000..9755213e --- /dev/null +++ b/src/be/nikiroo/fanfix/bundles/resources_gui.properties @@ -0,0 +1,190 @@ +# United States (en_US) resources_gui translation file (UTF-8) +# +# Note that any key can be doubled with a _NOUTF suffix +# to use when the NOUTF env variable is set to 1 +# +# Also, the comments always refer to the key below them. +# + + +# the title of the main window of Fanfix, the library +# (FORMAT: STRING) %s = current Fanfix version +TITLE_LIBRARY = Fanfix %s local library +# the title of the main window of Fanfix, the library, when the library has a name (i.e., is not local) +# (FORMAT: STRING) %s = current Fanfix version, %s = library name +TITLE_LIBRARY_WITH_NAME = Fanfix %s on %s +# the title of the configuration window of Fanfix, also the name of the menu button +# (FORMAT: STRING) +TITLE_CONFIG = Fanfix Configuration +# the subtitle of the configuration window of Fanfix +# (FORMAT: STRING) +SUBTITLE_CONFIG = This is where you configure the options of the program. +# the title of the UI configuration window of Fanfix, also the name of the menu button +# (FORMAT: STRING) +TITLE_CONFIG_UI = UI Configuration +# the subtitle of the UI configuration window of Fanfix +# (FORMAT: STRING) +SUBTITLE_CONFIG_UI = This is where you configure the graphical appearence of the program. +# the title of the 'save to/export to' window of Fanfix +# (FORMAT: STRING) +TITLE_SAVE = Save +# the title of the 'move to' window of Fanfix +# (FORMAT: STRING) +TITLE_MOVE_TO = Moving story +# the subtitle of the 'move to' window of Fanfix +# (FORMAT: STRING) +SUBTITLE_MOVE_TO = Move to: +# the title of the 'delete' window of Fanfix +# (FORMAT: STRING) +TITLE_DELETE = Delete story +# the subtitle of the 'delete' window of Fanfix +# (FORMAT: STRING) %s = LUID of the story, %s = title of the story +SUBTITLE_DELETE = Delete %s: %s +# the title of the 'library error' dialogue +# (FORMAT: STRING) +TITLE_ERROR_LIBRARY = Library error +# the title of the 'import URL' dialogue +# (FORMAT: STRING) +TITLE_IMPORT_URL = Importing from URL +# the subtitle of the 'import URL' dialogue +# (FORMAT: STRING) +SUBTITLE_IMPORT_URL = URL of the story to import: +# the title of general error dialogues +# (FORMAT: STRING) +TITLE_ERROR = Error +# the title of a story for the properties dialogue, the viewers... +# (FORMAT: STRING) %s = LUID of the story, %s = title of the story +TITLE_STORY = %s: %s +# HTML text used to notify of a new version +# (FORMAT: STRING) %s = url link in HTML +NEW_VERSION_AVAILABLE = A new version of the program is available at %s +# text used as title for the update dialogue +# (FORMAT: STRING) +NEW_VERSION_TITLE = Updates available +# HTML text used to specify a newer version title and number, used for each version newer than the current one +# (FORMAT: STRING) %s = the newer version number +NEW_VERSION_VERSION = Version %s +# show the number of words of a book +# (FORMAT: STRING) %s = the number +BOOK_COUNT_WORDS = %s words +# show the number of images of a book +# (FORMAT: STRING) %s = the number +BOOK_COUNT_IMAGES = %s images +# show the number of stories of a meta-book (a book representing allthe types/sources or all the authors present) +# (FORMAT: STRING) %s = the number +BOOK_COUNT_STORIES = %s stories +# the file menu (FORMAT: STRING) +MENU_FILE = File +# the file/exit menu button +# (FORMAT: STRING) +MENU_FILE_EXIT = Exit +# the file/import_file menu button +# (FORMAT: STRING) +MENU_FILE_IMPORT_FILE = Import File... +# the file/import_url menu button +# (FORMAT: STRING) +MENU_FILE_IMPORT_URL = Import URL... +# the file/export menu button +# (FORMAT: STRING) +MENU_FILE_EXPORT = Save as... +# the file/move to menu button +# (FORMAT: STRING) +MENU_FILE_MOVE_TO = Move to +# the file/set author menu button +# (FORMAT: STRING) +MENU_FILE_SET_AUTHOR = Set author +# the file/move to/new type-source menu button, that will trigger a dialogue to create a new type/source +# (FORMAT: STRING) +MENU_FILE_MOVE_TO_NEW_TYPE = New source... +# the file/move to/new author menu button, that will trigger a dialogue to create a new author +# (FORMAT: STRING) +MENU_FILE_MOVE_TO_NEW_AUTHOR = New author... +# the file/rename menu item, that will trigger a dialogue to ask for a new title for the story +# (FORMAT: STRING) +MENU_FILE_RENAME = Rename... +# the file/Properties menu item, that will trigger a dialogue to show the properties of the story +# (FORMAT: STRING) +MENU_FILE_PROPERTIES = Properties +# the file/open menu item, that will open the story or fake-story (an author or a source/type) +# (FORMAT: STRING) +MENU_FILE_OPEN = Open +# the edit menu (FORMAT: STRING) +MENU_EDIT = Edit +# the clear cache menu button, to clear the cache for a single book +# (FORMAT: STRING) +MENU_EDIT_CLEAR_CACHE = Clear cache +# the edit/redownload menu button, to download the latest version of the book +# (FORMAT: STRING) +MENU_EDIT_REDOWNLOAD = Redownload +# the edit/delete menu button +# (FORMAT: STRING) +MENU_EDIT_DELETE = Delete +# the edit/Set as cover for source menu button +# (FORMAT: STRING) +MENU_EDIT_SET_COVER_FOR_SOURCE = Set as cover for source +# the edit/Set as cover for author menu button +# (FORMAT: STRING) +MENU_EDIT_SET_COVER_FOR_AUTHOR = Set as cover for author +# the view menu (FORMAT: STRING) +MENU_VIEW = View +# the view/word_count menu button, to show the word/image/story count as secondary info +# (FORMAT: STRING) +MENU_VIEW_WCOUNT = Word count +# the view/author menu button, to show the author as secondary info +# (FORMAT: STRING) +MENU_VIEW_AUTHOR = Author +# the sources menu, to select the books from a specific source; also used as a title for the source books +# (FORMAT: STRING) +MENU_SOURCES = Sources +# the authors menu, to select the books of a specific author; also used as a title for the author books +# (FORMAT: STRING) +MENU_AUTHORS = Authors +# the options menu, to configure Fanfix from the GUI +# (FORMAT: STRING) +MENU_OPTIONS = Options +# a special menu button to select all the sources/types or authors, by group (one book = one group) +# (FORMAT: STRING) +MENU_XXX_ALL_GROUPED = All +# a special menu button to select all the sources/types or authors, in a listing (all the included books are listed, grouped by source/type or author) +# (FORMAT: STRING) +MENU_XXX_ALL_LISTING = Listing +# a special menu button to select the books without author +# (FORMAT: STRING) +MENU_AUTHORS_UNKNOWN = [unknown] +# progress bar caption for the 'removing old copy' step of 'redownload' +# (FORMAT: STRING) +PROGRESS_REDOWNLOAD_REMOVE_OLD_COPY = Removing old copy +# progress bar caption for the 'reload books' step of all outOfUi operations +# (FORMAT: STRING) +PROGRESS_OUT_OF_UI_RELOAD_BOOKS = Reload books +# default description if the error is not known +# (FORMAT: STRING) +ERROR_LIB_STATUS = An error occured when contacting the library +# library access not allowed +# (FORMAT: STRING) +ERROR_LIB_STATUS_UNAUTORIZED = You are not allowed to access this library +# the library is invalid (not correctly set up) +# (FORMAT: STRING) +ERROR_LIB_STATUS_INVALID = Library not valid +# the library is out of commission +# (FORMAT: STRING) +ERROR_LIB_STATUS_UNAVAILABLE = Library currently unavailable +# cannot open the book, internal or external viewer +# (FORMAT: STRING) +ERROR_CANNOT_OPEN = Cannot open the selected book +# URL is not supported by Fanfix +# (FORMAT: STRING) %s = URL +ERROR_URL_NOT_SUPPORTED = URL not supported: %s +# cannot import the URL +# (FORMAT: STRING) %s = URL, %s = reasons +ERROR_URL_IMPORT_FAILED = Failed to import %s:\n\ +%s +# (html) the chapter progression value used on the viewers +# (FORMAT: STRING) %d = chapter number, %d = total chapters +CHAPTER_HTML_UNNAMED =   Chapter

%d

/%d
+# (html) the chapter progression value used on the viewers +# (FORMAT: STRING) %d = chapter number, %d = total chapters, %s = chapter name +CHAPTER_HTML_NAMED =   Chapter

%d

/%d
: %s +# (html) the chapter progression value used on the viewers +# (FORMAT: STRING) %d = currnt image number, %d = total images +IMAGE_PROGRESSION = Image

%d

/%d diff --git a/src/be/nikiroo/fanfix/bundles/resources_gui_fr.properties b/src/be/nikiroo/fanfix/bundles/resources_gui_fr.properties new file mode 100644 index 00000000..8e832f0d --- /dev/null +++ b/src/be/nikiroo/fanfix/bundles/resources_gui_fr.properties @@ -0,0 +1,190 @@ +# français (fr) resources_gui translation file (UTF-8) +# +# Note that any key can be doubled with a _NOUTF suffix +# to use when the NOUTF env variable is set to 1 +# +# Also, the comments always refer to the key below them. +# + + +# the title of the main window of Fanfix, the library +# (FORMAT: STRING) %s = current Fanfix version +TITLE_LIBRARY = Fanfix %s librairie locale +# the title of the main window of Fanfix, the library, when the library has a name (i.e., is not local) +# (FORMAT: STRING) %s = current Fanfix version, %s = library name +TITLE_LIBRARY_WITH_NAME = Fanfix %s sur %s +# the title of the configuration window of Fanfix, also the name of the menu button +# (FORMAT: STRING) +TITLE_CONFIG = Configuration de Fanfix +# the subtitle of the configuration window of Fanfix +# (FORMAT: STRING) +SUBTITLE_CONFIG = C'est ici que vous pouvez configurer les options du programme. +# the title of the UI configuration window of Fanfix, also the name of the menu button +# (FORMAT: STRING) +TITLE_CONFIG_UI = Configuration de l'interface +# the subtitle of the UI configuration window of Fanfix +# (FORMAT: STRING) +SUBTITLE_CONFIG_UI = C'est ici que vous pouvez configurer les options de l'apparence de l'application. +# the title of the 'save to/export to' window of Fanfix +# (FORMAT: STRING) +TITLE_SAVE = Sauver +# the title of the 'move to' window of Fanfix +# (FORMAT: STRING) +TITLE_MOVE_TO = Déplacer le livre +# the subtitle of the 'move to' window of Fanfix +# (FORMAT: STRING) +SUBTITLE_MOVE_TO = Déplacer vers : +# the title of the 'delete' window of Fanfix +# (FORMAT: STRING) +TITLE_DELETE = Supprimer le livre +# the subtitle of the 'delete' window of Fanfix +# (FORMAT: STRING) %s = LUID of the story, %s = title of the story +SUBTITLE_DELETE = Supprimer %s : %s +# the title of the 'library error' dialogue +# (FORMAT: STRING) +TITLE_ERROR_LIBRARY = Erreur avec la librairie +# the title of the 'import URL' dialogue +# (FORMAT: STRING) +TITLE_IMPORT_URL = Importer depuis une URL +# the subtitle of the 'import URL' dialogue +# (FORMAT: STRING) +SUBTITLE_IMPORT_URL = L'URL du livre à importer +# the title of general error dialogues +# (FORMAT: STRING) +TITLE_ERROR = Error +# the title of a story for the properties dialogue, the viewers... +# (FORMAT: STRING) %s = LUID of the story, %s = title of the story +TITLE_STORY = %s: %s +# HTML text used to notify of a new version +# (FORMAT: STRING) %s = url link in HTML +NEW_VERSION_AVAILABLE = Une nouvelle version du programme est disponible sur %s +# text used as title for the update dialogue +# (FORMAT: STRING) +NEW_VERSION_TITLE = Mise-à-jour disponible +# HTML text used to specify a newer version title and number, used for each version newer than the current one +# (FORMAT: STRING) %s = the newer version number +NEW_VERSION_VERSION = Version %s +# show the number of words of a book +# (FORMAT: STRING) %s = the number +BOOK_COUNT_WORDS = %s mots +# show the number of images of a book +# (FORMAT: STRING) %s = the number +BOOK_COUNT_IMAGES = %s images +# show the number of stories of a meta-book (a book representing allthe types/sources or all the authors present) +# (FORMAT: STRING) %s = the number +BOOK_COUNT_STORIES = %s livres +# the file menu (FORMAT: STRING) +MENU_FILE = Fichier +# the file/exit menu button +# (FORMAT: STRING) +MENU_FILE_EXIT = Quiter +# the file/import_file menu button +# (FORMAT: STRING) +MENU_FILE_IMPORT_FILE = Importer un fichier... +# the file/import_url menu button +# (FORMAT: STRING) +MENU_FILE_IMPORT_URL = Importer une URL... +# the file/export menu button +# (FORMAT: STRING) +MENU_FILE_EXPORT = Sauver sous... +# the file/move to menu button +# (FORMAT: STRING) +MENU_FILE_MOVE_TO = Déplacer vers +# the file/set author menu button +# (FORMAT: STRING) +MENU_FILE_SET_AUTHOR = Changer l'auteur +# the file/move to/new type-source menu button, that will trigger a dialogue to create a new type/source +# (FORMAT: STRING) +MENU_FILE_MOVE_TO_NEW_TYPE = Nouvelle source... +# the file/move to/new author menu button, that will trigger a dialogue to create a new author +# (FORMAT: STRING) +MENU_FILE_MOVE_TO_NEW_AUTHOR = Nouvel auteur... +# the file/rename menu item, that will trigger a dialogue to ask for a new title for the story +# (FORMAT: STRING) +MENU_FILE_RENAME = Renommer... +# the file/Properties menu item, that will trigger a dialogue to show the properties of the story +# (FORMAT: STRING) +MENU_FILE_PROPERTIES = Propriétés +# the file/open menu item, that will open the story or fake-story (an author or a source/type) +# (FORMAT: STRING) +MENU_FILE_OPEN = Ouvrir +# the edit menu (FORMAT: STRING) +MENU_EDIT = Edition +# the clear cache menu button, to clear the cache for a single book +# (FORMAT: STRING) +MENU_EDIT_CLEAR_CACHE = Nettoyer le cache +# the edit/redownload menu button, to download the latest version of the book +# (FORMAT: STRING) +MENU_EDIT_REDOWNLOAD = Re-downloader +# the edit/delete menu button +# (FORMAT: STRING) +MENU_EDIT_DELETE = Supprimer +# the edit/Set as cover for source menu button +# (FORMAT: STRING) +MENU_EDIT_SET_COVER_FOR_SOURCE = Utiliser comme cover pour la source +# the edit/Set as cover for author menu button +# (FORMAT: STRING) +MENU_EDIT_SET_COVER_FOR_AUTHOR = Utiliser comme cover pour l'auteur +# the view menu (FORMAT: STRING) +MENU_VIEW = Affichage +# the view/word_count menu button, to show the word/image/story count as secondary info +# (FORMAT: STRING) +MENU_VIEW_WCOUNT = Nombre de mots +# the view/author menu button, to show the author as secondary info +# (FORMAT: STRING) +MENU_VIEW_AUTHOR = Auteur +# the sources menu, to select the books from a specific source; also used as a title for the source books +# (FORMAT: STRING) +MENU_SOURCES = Sources +# the authors menu, to select the books of a specific author; also used as a title for the author books +# (FORMAT: STRING) +MENU_AUTHORS = Auteurs +# the options menu, to configure Fanfix from the GUI +# (FORMAT: STRING) +MENU_OPTIONS = Options +# a special menu button to select all the sources/types or authors, by group (one book = one group) +# (FORMAT: STRING) +MENU_XXX_ALL_GROUPED = Tout +# a special menu button to select all the sources/types or authors, in a listing (all the included books are listed, grouped by source/type or author) +# (FORMAT: STRING) +MENU_XXX_ALL_LISTING = Listing +# a special menu button to select the books without author +# (FORMAT: STRING) +MENU_AUTHORS_UNKNOWN = [inconnu] +# progress bar caption for the 'removing old copy' step of 'redownload' +# (FORMAT: STRING) +PROGRESS_REDOWNLOAD_REMOVE_OLD_COPY = Suppression de l'ancienne version +# progress bar caption for the 'reload books' step of all outOfUi operations +# (FORMAT: STRING) +PROGRESS_OUT_OF_UI_RELOAD_BOOKS = Recharger les livres +# default description if the error is not known +# (FORMAT: STRING) +ERROR_LIB_STATUS = Une erreur est survenue en contactant la librairie +# library access not allowed +# (FORMAT: STRING) +ERROR_LIB_STATUS_UNAUTORIZED = Vous n'étes pas autorisé à accéder à cette librairie +# the library is invalid (not correctly set up) +# (FORMAT: STRING) +ERROR_LIB_STATUS_INVALID = Librairie invalide +# the library is out of commission +# (FORMAT: STRING) +ERROR_LIB_STATUS_UNAVAILABLE = Librairie indisponible +# cannot open the book, internal or external viewer +# (FORMAT: STRING) +ERROR_CANNOT_OPEN = Impossible d'ouvrir le livre sélectionné +# URL is not supported by Fanfix +# (FORMAT: STRING) %s = URL +ERROR_URL_NOT_SUPPORTED = URL non supportée : %s +# cannot import the URL +# (FORMAT: STRING) %s = URL, %s = reasons +ERROR_URL_IMPORT_FAILED = Erreur lors de l'import de %s:\n\ +%s +# (html) the chapter progression value used on the viewers +# (FORMAT: STRING) %d = chapter number, %d = total chapters +CHAPTER_HTML_UNNAMED =   Chapitre

%d

/%d
+# (html) the chapter progression value used on the viewers +# (FORMAT: STRING) %d = chapter number, %d = total chapters, %s = chapter name +CHAPTER_HTML_NAMED =   Chapitre

%d

/%d
: %s +# (html) the chapter progression value used on the viewers +# (FORMAT: STRING) %d = currnt image number, %d = total images +IMAGE_PROGRESSION = Image

%d

/%d diff --git a/src/be/nikiroo/fanfix/reader/ui/GuiReader.java b/src/be/nikiroo/fanfix/reader/ui/GuiReader.java index c6c84136..f4a932b3 100644 --- a/src/be/nikiroo/fanfix/reader/ui/GuiReader.java +++ b/src/be/nikiroo/fanfix/reader/ui/GuiReader.java @@ -17,6 +17,7 @@ import javax.swing.event.HyperlinkListener; import be.nikiroo.fanfix.Instance; import be.nikiroo.fanfix.VersionCheck; +import be.nikiroo.fanfix.bundles.StringIdGui; import be.nikiroo.fanfix.bundles.UiConfig; import be.nikiroo.fanfix.data.MetaData; import be.nikiroo.fanfix.data.Story; @@ -116,11 +117,14 @@ class GuiReader extends BasicReader { final JEditorPane updateMessage = new JEditorPane("text/html", ""); if (updates.isNewVersionAvailable()) { - builder.append("A new version of the program is available at https://github.com/nikiroo/fanfix/releases"); + builder.append(trans(StringIdGui.NEW_VERSION_AVAILABLE, + "https://github.com/nikiroo/fanfix/releases")); builder.append("
"); builder.append("
"); for (Version v : updates.getNewer()) { - builder.append("\tVersion " + v + ""); + builder.append("\t" + + trans(StringIdGui.NEW_VERSION_VERSION, v.toString()) + + ""); builder.append("
"); builder.append("