├── .gitignore ├── docs └── apidocs │ ├── package-list │ ├── script.js │ ├── overview-frame.html │ ├── com │ └── github │ │ └── naoghuman │ │ └── lib │ │ └── i18n │ │ ├── internal │ │ ├── package-frame.html │ │ ├── package-use.html │ │ ├── class-use │ │ │ ├── DefaultI18NBinding.html │ │ │ ├── DefaultI18NValidator.html │ │ │ └── DefaultI18NResourceBundle.html │ │ └── package-tree.html │ │ └── core │ │ ├── package-frame.html │ │ └── class-use │ │ ├── I18NBindingBuilder.html │ │ ├── I18NMessageBuilder.html │ │ ├── I18NResourceBundleBuilder.html │ │ └── I18NFacade.html │ ├── index.html │ ├── deprecated-list.html │ ├── constant-values.html │ ├── allclasses-noframe.html │ ├── allclasses-frame.html │ └── overview-summary.html ├── src ├── test │ ├── resources │ │ ├── com │ │ │ └── github │ │ │ │ └── naoghuman │ │ │ │ └── lib │ │ │ │ └── i18n │ │ │ │ ├── license_flags.txt │ │ │ │ ├── Italien.png │ │ │ │ ├── Deutschland.png │ │ │ │ ├── Frankreich.png │ │ │ │ ├── Vereinigtes-Koenigreich.png │ │ │ │ ├── internal │ │ │ │ ├── binding_de.properties │ │ │ │ ├── binding_en.properties │ │ │ │ ├── resourcebundle_de.properties │ │ │ │ └── resourcebundle_en.properties │ │ │ │ ├── demo_i18n_it.properties │ │ │ │ ├── demo_i18n_en.properties │ │ │ │ ├── demo_i18n_de.properties │ │ │ │ ├── demo_i18n_fr.properties │ │ │ │ ├── demoi18n.css │ │ │ │ └── demoi18n.fxml │ │ └── log4j2.xml │ └── java │ │ └── com │ │ └── github │ │ └── naoghuman │ │ └── lib │ │ └── i18n │ │ ├── core │ │ ├── I18NFacadeTest.java │ │ ├── I18NMessageBuilderTest.java │ │ ├── I18NBindingBuilderTest.java │ │ └── I18NResourceBundleBuilderTest.java │ │ ├── DemoI18NStart.java │ │ ├── internal │ │ ├── DefaultI18NValidatorTest.java │ │ └── DefaultI18NBindingTest.java │ │ └── DemoI18NController.java └── main │ └── java │ └── com │ └── github │ └── naoghuman │ └── lib │ └── i18n │ ├── internal │ ├── package-info.java │ ├── DefaultI18NBinding.java │ ├── DefaultI18NResourceBundle.java │ └── DefaultI18NValidator.java │ └── core │ ├── package-info.java │ ├── I18NFacade.java │ └── I18NBinding.java ├── .travis.yml ├── concept ├── _Concept_Template_vX.Y.Z_yyyy-MM-dd.txt ├── Concept_Basic-library-idea.txt ├── Concept_Convention_v0.7.0_2018-12-12.txt └── Concept_Features_v0.7.0_2018-12-27.txt ├── release ├── Release_vX.Y.Z_yyyy-MM-dd_HH-mm.md ├── Release_v0.1.0-PRERELEASE_2018-10-23_05-25.md ├── Release_v0.7.2_2019-04-22_09-32.md ├── Release_v0.3.0-PRERELEASE_2018-11-11_19-10.md ├── Release_v0.7.1_2019-02-10_19-16.md ├── Release_v0.4.0-PRERELEASE_2018-11-15_21-10.md ├── Release_v0.6.0_2018-11-23_00-59.md ├── Release_v0.2.0-PRERELEASE_2018-11-06_02-22.md ├── Release_v0.8.0_2019-04-28_13-36.md ├── Release_v0.5.0_2018-11-18_16-55.md ├── Release_v0.6.1_2018-12-08_18-45.md └── Release_v0.7.0_2018-12-29_21-21.md ├── nb-configuration.xml ├── nbactions.xml └── pom.xml /.gitignore: -------------------------------------------------------------------------------- 1 | /target/ 2 | /todo/ 3 | /nbproject/ 4 | /log/ -------------------------------------------------------------------------------- /docs/apidocs/package-list: -------------------------------------------------------------------------------- 1 | com.github.naoghuman.lib.i18n.core 2 | com.github.naoghuman.lib.i18n.internal 3 | -------------------------------------------------------------------------------- /src/test/resources/com/github/naoghuman/lib/i18n/license_flags.txt: -------------------------------------------------------------------------------- 1 | All flag-images haven't any license. 2 | See http://www.kostenlose-landkarten.de for more information. -------------------------------------------------------------------------------- /src/test/resources/com/github/naoghuman/lib/i18n/Italien.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Naoghuman/lib-i18n/HEAD/src/test/resources/com/github/naoghuman/lib/i18n/Italien.png -------------------------------------------------------------------------------- /src/test/resources/com/github/naoghuman/lib/i18n/Deutschland.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Naoghuman/lib-i18n/HEAD/src/test/resources/com/github/naoghuman/lib/i18n/Deutschland.png -------------------------------------------------------------------------------- /src/test/resources/com/github/naoghuman/lib/i18n/Frankreich.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Naoghuman/lib-i18n/HEAD/src/test/resources/com/github/naoghuman/lib/i18n/Frankreich.png -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: java 2 | jdk: 3 | - oraclejdk8 4 | sudo: false 5 | install: true 6 | script: mvn clean install 7 | cache: 8 | directories: 9 | - $HOME/.m2 10 | 11 | -------------------------------------------------------------------------------- /src/test/resources/com/github/naoghuman/lib/i18n/Vereinigtes-Koenigreich.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Naoghuman/lib-i18n/HEAD/src/test/resources/com/github/naoghuman/lib/i18n/Vereinigtes-Koenigreich.png -------------------------------------------------------------------------------- /concept/_Concept_Template_vX.Y.Z_yyyy-MM-dd.txt: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- 2 | CONCEPT 3 | -------------------------------------------------------------------------------- 4 | INTENTION 5 | - ... 6 | 7 | -------------------------------------------------------------------------------- 8 | SPECIFICATION 9 | - ... 10 | 11 | -------------------------------------------------------------------------------- 12 | LINKS 13 | - ... 14 | 15 | -------------------------------------------------------------------------------- 16 | EXTRAS 17 | - ... 18 | 19 | -------------------------------------------------------------------------------- 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /src/test/resources/com/github/naoghuman/lib/i18n/internal/binding_de.properties: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2018 Naoghuman's dream 2 | # 3 | # This program is free software: you can redistribute it and/or modify 4 | # it under the terms of the GNU General Public License as published by 5 | # the Free Software Foundation, either version 3 of the License, or 6 | # (at your option) any later version. 7 | # 8 | # This program is distributed in the hope that it will be useful, 9 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | # GNU General Public License for more details. 12 | # 13 | # You should have received a copy of the GNU General Public License 14 | # along with this program. If not, see . 15 | 16 | binding.label.with.parameter=B: Text mit Parameter: {0} 17 | binding.title=B: Test Titel 18 | -------------------------------------------------------------------------------- /src/test/resources/com/github/naoghuman/lib/i18n/internal/binding_en.properties: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2018 Naoghuman's dream 2 | # 3 | # This program is free software: you can redistribute it and/or modify 4 | # it under the terms of the GNU General Public License as published by 5 | # the Free Software Foundation, either version 3 of the License, or 6 | # (at your option) any later version. 7 | # 8 | # This program is distributed in the hope that it will be useful, 9 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | # GNU General Public License for more details. 12 | # 13 | # You should have received a copy of the GNU General Public License 14 | # along with this program. If not, see . 15 | 16 | binding.label.with.parameter=B: Text with parameter: {0} 17 | binding.title=B: Test title 18 | -------------------------------------------------------------------------------- /src/test/resources/com/github/naoghuman/lib/i18n/internal/resourcebundle_de.properties: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2018 Naoghuman's dream 2 | # 3 | # This program is free software: you can redistribute it and/or modify 4 | # it under the terms of the GNU General Public License as published by 5 | # the Free Software Foundation, either version 3 of the License, or 6 | # (at your option) any later version. 7 | # 8 | # This program is distributed in the hope that it will be useful, 9 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | # GNU General Public License for more details. 12 | # 13 | # You should have received a copy of the GNU General Public License 14 | # along with this program. If not, see . 15 | 16 | resourcebundle.label.with.parameter=RB: Text mit Parameter: {0} 17 | resourcebundle.title=RB: Test Titel -------------------------------------------------------------------------------- /src/test/resources/com/github/naoghuman/lib/i18n/internal/resourcebundle_en.properties: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2018 Naoghuman's dream 2 | # 3 | # This program is free software: you can redistribute it and/or modify 4 | # it under the terms of the GNU General Public License as published by 5 | # the Free Software Foundation, either version 3 of the License, or 6 | # (at your option) any later version. 7 | # 8 | # This program is distributed in the hope that it will be useful, 9 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | # GNU General Public License for more details. 12 | # 13 | # You should have received a copy of the GNU General Public License 14 | # along with this program. If not, see . 15 | 16 | resourcebundle.label.with.parameter=RB: Text with parameter: {0} 17 | resourcebundle.title=RB: Test title 18 | -------------------------------------------------------------------------------- /docs/apidocs/script.js: -------------------------------------------------------------------------------- 1 | function show(type) 2 | { 3 | count = 0; 4 | for (var key in methods) { 5 | var row = document.getElementById(key); 6 | if ((methods[key] & type) != 0) { 7 | row.style.display = ''; 8 | row.className = (count++ % 2) ? rowColor : altColor; 9 | } 10 | else 11 | row.style.display = 'none'; 12 | } 13 | updateTabs(type); 14 | } 15 | 16 | function updateTabs(type) 17 | { 18 | for (var value in tabs) { 19 | var sNode = document.getElementById(tabs[value][0]); 20 | var spanNode = sNode.firstChild; 21 | if (value == type) { 22 | sNode.className = activeTableTab; 23 | spanNode.innerHTML = tabs[value][1]; 24 | } 25 | else { 26 | sNode.className = tableTab; 27 | spanNode.innerHTML = "" + tabs[value][1] + ""; 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /release/Release_vX.Y.Z_yyyy-MM-dd_HH-mm.md: -------------------------------------------------------------------------------- 1 | Welcome to `Lib-I18n` with the new release `x.y.z`. 2 | 3 | The library `Lib-I18N` allows a developer to bind a key-value pair of a`.properties` 4 | file to a [StringBinding]. This makes it very easy to change the language during 5 | runtime in a [JavaFX] application. 6 | Lib-I18N is written in JavaFX, [Maven] and [NetBeans]. 7 | 8 | 9 | 10 | #### Summary 11 | * ... 12 | * ... 13 | 14 | 15 | 16 | #### Bug 17 | 18 | 19 | 20 | #### Feature 21 | 22 | 23 | 24 | #### Enhancement 25 | 26 | 27 | 28 | #### Test 29 | 30 | 31 | 32 | #### Documentation 33 | 34 | 35 | 36 | #### Refactoring 37 | 38 | 39 | 40 | #### Additional 41 | 42 | 43 | 44 | Greetings 45 | Naoghuman 46 | 47 | 48 | 49 | [//]: # (Issues which will be integrated in this release) 50 | 51 | 52 | 53 | [//]: # (Links) 54 | [JavaFX]:http://docs.oracle.com/javase/8/javase-clienttechnologies.htm 55 | [Maven]:http://maven.apache.org/ 56 | [NetBeans]:https://netbeans.org/ 57 | [StringBinding]:https://docs.oracle.com/javase/8/javafx/api/javafx/beans/binding/StringBinding.html 58 | -------------------------------------------------------------------------------- /release/Release_v0.1.0-PRERELEASE_2018-10-23_05-25.md: -------------------------------------------------------------------------------- 1 | Welcome to `Lib-I18n` with the new release `0.1.0-PRERELEASE`. 2 | 3 | TODO 4 | 5 | 6 | 7 | #### Summary 8 | * Implement basic library structure. 9 | * Connect the library to Travis CI. 10 | 11 | 12 | 13 | #### Feature 14 | #5 [pom] Tweak the `pom.xml` to fit the necessities from the project. 15 | #3 [lib] Add badges from img.shield.io to the ReadMe.md. 16 | #2 [ci] Connect the GitHub project with Travis CI. 17 | #1 [lib] Create basic library structure. 18 | 19 | 20 | 21 | #### Enhancement 22 | 23 | 24 | 25 | #### Bug 26 | 27 | 28 | 29 | #### Documentation 30 | #4 [doc] Create basic concept for the library. 31 | 32 | 33 | 34 | #### Refactoring 35 | 36 | 37 | 38 | #### Additional 39 | 40 | 41 | 42 | Greetings 43 | Naoghuman 44 | 45 | 46 | 47 | [//]: # (Issues which will be integrated in this release) 48 | 49 | 50 | 51 | [//]: # (Links) 52 | [Apache Log4j 2]:https://logging.apache.org/log4j/2.0/index.html 53 | [JavaFX]:http://docs.oracle.com/javase/8/javase-clienttechnologies.htm 54 | [Maven]:http://maven.apache.org/ 55 | 56 | 57 | -------------------------------------------------------------------------------- /nb-configuration.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 9 | 10 | 16 | gpl30 17 | 18 | 19 | -------------------------------------------------------------------------------- /docs/apidocs/overview-frame.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Overview List (Lib-I18N 0.8.0 API) 8 | 9 | 10 | 11 | 12 | 13 | 14 | 21 |

 

22 | 23 | 24 | -------------------------------------------------------------------------------- /src/test/resources/com/github/naoghuman/lib/i18n/demo_i18n_it.properties: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2018 Naoghuman's dream 2 | # 3 | # This program is free software: you can redistribute it and/or modify 4 | # it under the terms of the GNU General Public License as published by 5 | # the Free Software Foundation, either version 3 of the License, or 6 | # (at your option) any later version. 7 | # 8 | # This program is distributed in the hope that it will be useful, 9 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | # GNU General Public License for more details. 12 | # 13 | # You should have received a copy of the GNU General Public License 14 | # along with this program. If not, see . 15 | 16 | demo.i18n.about=Lib-FXML \u00e8 sviluppato da Naoghuman! 17 | demo.i18n.greetings=Ciao 18 | demo.i18n.from=di 19 | demo.i18n.land=Italy 20 | demo.i18n.languages=Lingue 21 | demo.i18n.language.german=Tedesco 22 | demo.i18n.language.english=Inglese 23 | demo.i18n.language.italian=Italiano 24 | demo.i18n.language.french=Francese 25 | #demo.i18n.language.counter=(Cambia lingua: de={0}, en={1}, fr={2}, it={3}) 26 | -------------------------------------------------------------------------------- /src/test/resources/com/github/naoghuman/lib/i18n/demo_i18n_en.properties: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2018 Naoghuman's dream 2 | # 3 | # This program is free software: you can redistribute it and/or modify 4 | # it under the terms of the GNU General Public License as published by 5 | # the Free Software Foundation, either version 3 of the License, or 6 | # (at your option) any later version. 7 | # 8 | # This program is distributed in the hope that it will be useful, 9 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | # GNU General Public License for more details. 12 | # 13 | # You should have received a copy of the GNU General Public License 14 | # along with this program. If not, see . 15 | 16 | demo.i18n.about=Lib-FXML is developed by Naoghuman! 17 | demo.i18n.greetings=Hi 18 | demo.i18n.from=from 19 | demo.i18n.land=United Kingdom 20 | demo.i18n.languages=Languages 21 | demo.i18n.language.german=German 22 | demo.i18n.language.english=English 23 | demo.i18n.language.italian=Italian 24 | demo.i18n.language.french=French 25 | #demo.i18n.language.counter=(Change of language: de={0}, en={1}, fr={2}, it={3}) 26 | -------------------------------------------------------------------------------- /src/test/resources/com/github/naoghuman/lib/i18n/demo_i18n_de.properties: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2018 Naoghuman's dream 2 | # 3 | # This program is free software: you can redistribute it and/or modify 4 | # it under the terms of the GNU General Public License as published by 5 | # the Free Software Foundation, either version 3 of the License, or 6 | # (at your option) any later version. 7 | # 8 | # This program is distributed in the hope that it will be useful, 9 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | # GNU General Public License for more details. 12 | # 13 | # You should have received a copy of the GNU General Public License 14 | # along with this program. If not, see . 15 | 16 | demo.i18n.about=Lib-FXML ist entwickelt von Naoghuman! 17 | demo.i18n.greetings=Hallo 18 | demo.i18n.from=von 19 | demo.i18n.land=Deutschland 20 | demo.i18n.languages=Sprachen 21 | demo.i18n.language.german=Deutsch 22 | demo.i18n.language.english=Englisch 23 | demo.i18n.language.italian=Italienisch 24 | demo.i18n.language.french=Franz\u00f6sisch 25 | #demo.i18n.language.counter=(Sprachwechsel: de={0}, en={1}, fr={2}, it={3}) 26 | -------------------------------------------------------------------------------- /src/test/resources/com/github/naoghuman/lib/i18n/demo_i18n_fr.properties: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2018 Naoghuman's dream 2 | # 3 | # This program is free software: you can redistribute it and/or modify 4 | # it under the terms of the GNU General Public License as published by 5 | # the Free Software Foundation, either version 3 of the License, or 6 | # (at your option) any later version. 7 | # 8 | # This program is distributed in the hope that it will be useful, 9 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | # GNU General Public License for more details. 12 | # 13 | # You should have received a copy of the GNU General Public License 14 | # along with this program. If not, see . 15 | 16 | demo.i18n.about=Lib-FXML est d\u00e9velopp\u00e9 par Naoghuman! 17 | demo.i18n.greetings=Bonjour 18 | demo.i18n.from=de 19 | demo.i18n.land=France 20 | demo.i18n.languages=Langues 21 | demo.i18n.language.german=Allemand 22 | demo.i18n.language.english=Anglais 23 | demo.i18n.language.italian=Italien 24 | demo.i18n.language.french=Fran\u00e7ais 25 | #demo.i18n.language.counter=(Changement de langue: de={0}, en={1}, fr={2}, it={3}) 26 | -------------------------------------------------------------------------------- /release/Release_v0.7.2_2019-04-22_09-32.md: -------------------------------------------------------------------------------- 1 | Welcome to `Lib-I18n` with the new release `0.7.2`. 2 | 3 | The library `Lib-I18N` allows a developer to bind a key-value pair of a`.properties` 4 | file to a [StringBinding]. This makes it very easy to change the language during 5 | runtime in a [JavaFX] application. 6 | Lib-I18N is written in JavaFX, [Maven] and [NetBeans]. 7 | 8 | 9 | 10 | #### Summary 11 | * This is a minor release. 12 | * Some typos in the ReadMe are fixed. 13 | 14 | 15 | 16 | #### Bug 17 | 18 | 19 | 20 | #### Feature 21 | 22 | 23 | #### Enhancement 24 | 25 | 26 | 27 | #### Test 28 | 29 | 30 | 31 | #### Documentation 32 | #84 [doc] Extend the example in the convention 'Key not found'. 33 | #83 [doc] Typo in first section in 'Examples'. 34 | #82 [doc] Typo in section 'Convention: Key not found'. 35 | #80 [doc] Typo in sub-section from 'Features'. 36 | 37 | 38 | 39 | #### Refactoring 40 | 41 | 42 | 43 | #### Additional 44 | 45 | 46 | 47 | Greetings 48 | Naoghuman 49 | 50 | 51 | 52 | [//]: # (Issues which will be integrated in this release) 53 | 54 | 55 | 56 | [//]: # (Links) 57 | [JavaFX]:http://docs.oracle.com/javase/8/javase-clienttechnologies.htm 58 | [Maven]:http://maven.apache.org/ 59 | [NetBeans]:https://netbeans.org/ 60 | [StringBinding]:https://docs.oracle.com/javase/8/javafx/api/javafx/beans/binding/StringBinding.html 61 | -------------------------------------------------------------------------------- /docs/apidocs/com/github/naoghuman/lib/i18n/internal/package-frame.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | com.github.naoghuman.lib.i18n.internal (Lib-I18N 0.8.0 API) 8 | 9 | 10 | 11 | 12 | 13 |

com.github.naoghuman.lib.i18n.internal

14 |
15 |

Classes

16 | 21 |
22 | 23 | 24 | -------------------------------------------------------------------------------- /src/main/java/com/github/naoghuman/lib/i18n/internal/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2018 Naoghuman's dream 3 | * 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | /** 18 | * The {@code internal} package from the library {@code Lib-I18N} contains on the one side 19 | * the {@code default} implementations from the interfaces from the library {@code core} package 20 | * and on the other side a default {@code validator} for precondition checks. 21 | * 22 | * @since 0.1.0-PRERELEASE 23 | * @version 0.6.1 24 | * @author Naoghuman 25 | * @see com.github.naoghuman.lib.i18n.core.I18NBinding 26 | * @see com.github.naoghuman.lib.i18n.core.I18NResourceBundle 27 | * @see com.github.naoghuman.lib.i18n.internal.DefaultI18NValidator 28 | */ 29 | package com.github.naoghuman.lib.i18n.internal; 30 | -------------------------------------------------------------------------------- /src/test/resources/com/github/naoghuman/lib/i18n/demoi18n.css: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2018 Naoghuman's dream 3 | 4 | This program is free software: you can redistribute it and/or modify 5 | it under the terms of the GNU General Public License as published by 6 | the Free Software Foundation, either version 3 of the License, or 7 | (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | GNU General Public License for more details. 13 | 14 | You should have received a copy of the GNU General Public License 15 | along with this program. If not, see . 16 | */ 17 | /* 18 | Created on : 25.04.2019, 10:59:43 19 | Since : 0.8.0 20 | Version : 0.8.0 21 | Author : Naoghuman 22 | */ 23 | .anchor-pane { 24 | -fx-background-color:#A7FFEB; 25 | } 26 | 27 | .button { 28 | -fx-background-color:#A7FFEB; 29 | -fx-background-radius:0; 30 | -fx-background-insets: 0; 31 | -fx-text-fill:BLACK; 32 | } 33 | .button:hover { 34 | -fx-background-color:rgba(0, 0, 0, 0.20); 35 | } 36 | .button:pressed { 37 | -fx-background-color:rgba(0, 0, 0, 0.35); 38 | -fx-text-fill:WHITE; 39 | } 40 | 41 | .label { 42 | -fx-background-color:#1DE9B6, rgba(0, 0, 0, 0.20); 43 | } 44 | 45 | .image-view { 46 | -fx-effect: dropshadow(three-pass-box, rgba(0, 0, 0, 0.5), 12, 0, 0, 0); 47 | } 48 | 49 | .vbox-navigation { 50 | -fx-background-color:#1DE9B6; 51 | } 52 | 53 | -------------------------------------------------------------------------------- /release/Release_v0.3.0-PRERELEASE_2018-11-11_19-10.md: -------------------------------------------------------------------------------- 1 | Welcome to `Lib-I18n` with the new release `0.3.0-PRERELEASE`. 2 | 3 | The library `Lib-I18N` allowed the developer to bind easly `.properties` key 4 | (values) to a [StringBinding] or [Callable<String>]. So changing the 5 | language during runtime in a [JavaFX] application won't be a problem anymore. 6 | Lib-I18N is written in JavaFX, [Maven] and [NetBeans]. 7 | 8 | 9 | 10 | #### Summary 11 | * ... 12 | * ... 13 | 14 | 15 | 16 | #### Feature 17 | #16 [test] Add 'UnitTests' for the classes in 'internal' package. 18 | 19 | 20 | 21 | #### Enhancement 22 | 23 | 24 | 25 | #### Bug 26 | 27 | 28 | 29 | #### Documentation 30 | #21 [doc] Update chapter 'Example' with examples for the xy builders. 31 | #15 [doc] Remove UML section in chapter Intention. 32 | 33 | 34 | 35 | #### Refactoring 36 | #20 [api] Remove the interface I18NValidator. 37 | #19 [api] Rename I18NMessageBuilder to I18NResourceBundleMessageBuilder. 38 | 39 | 40 | 41 | #### Additional 42 | 43 | 44 | 45 | Greetings 46 | Naoghuman 47 | 48 | 49 | 50 | [//]: # (Issues which will be integrated in this release) 51 | 52 | 53 | 54 | [//]: # (Links) 55 | [Callable<String>]:https://docs.oracle.com/javase/8/docs/api/index.html?java/util/concurrent/Callable.html 56 | [JavaFX]:http://docs.oracle.com/javase/8/javase-clienttechnologies.htm 57 | [Maven]:http://maven.apache.org/ 58 | [NetBeans]:https://netbeans.org/ 59 | [StringBinding]:https://docs.oracle.com/javase/8/javafx/api/javafx/beans/binding/StringBinding.html 60 | -------------------------------------------------------------------------------- /release/Release_v0.7.1_2019-02-10_19-16.md: -------------------------------------------------------------------------------- 1 | Welcome to `Lib-I18n` with the new release `0.7.1`. 2 | 3 | The library `Lib-I18N` allows a developer to bind a key-value pair of a`.properties` 4 | file to a [StringBinding]. This makes it very easy to change the language during 5 | runtime in a [JavaFX] application. 6 | Lib-I18N is written in JavaFX, [Maven] and [NetBeans]. 7 | 8 | 9 | 10 | #### Summary 11 | * Update the section 'Conventions'. Add for every convention an example. 12 | * Restructure the section 'Features'. Split it into 'generall' and 'main' features. 13 | 14 | 15 | 16 | #### Feature 17 | 18 | 19 | 20 | #### Enhancement 21 | 22 | 23 | 24 | #### Bug 25 | #79 [bug] If the ResourceBundle doesn't exist then a spezific MissingResourceException will thrown. 26 | 27 | 28 | 29 | #### Documentation 30 | #77 [doc] Add tag 'p' after all lists in JavaDoc. 31 | #76 [doc] Update JavaDoc in I18NBinding. 32 | #75 [doc] Update every sub-section from 'Features'. 33 | #74 [doc] Update every sub-section from 'Conventions'. Add examples to them. 34 | #73 [doc] Update section 'Conventions', sub-section 'key-not-found'. 35 | 36 | 37 | 38 | #### Refactoring 39 | 40 | 41 | 42 | #### Additional 43 | 44 | 45 | 46 | Greetings 47 | Naoghuman 48 | 49 | 50 | 51 | [//]: # (Issues which will be integrated in this release) 52 | 53 | 54 | 55 | [//]: # (Links) 56 | [JavaFX]:http://docs.oracle.com/javase/8/javase-clienttechnologies.htm 57 | [Maven]:http://maven.apache.org/ 58 | [NetBeans]:https://netbeans.org/ 59 | [StringBinding]:https://docs.oracle.com/javase/8/javafx/api/javafx/beans/binding/StringBinding.html 60 | -------------------------------------------------------------------------------- /release/Release_v0.4.0-PRERELEASE_2018-11-15_21-10.md: -------------------------------------------------------------------------------- 1 | Welcome to `Lib-I18n` with the new release `0.4.0-PRERELEASE`. 2 | 3 | The library `Lib-I18N` allowed the developer to bind easly `.properties` key 4 | (values) to a [StringBinding] or [Callable<String>]. So changing the 5 | language during runtime in a [JavaFX] application won't be a problem anymore. 6 | Lib-I18N is written in JavaFX, [Maven] and [NetBeans]. 7 | 8 | 9 | 10 | #### Summary 11 | * Add 'UnitTests' for the class 'I18NFacade'. 12 | * Update the ReadMe. 13 | 14 | 15 | 16 | #### Feature 17 | #17 [test] Add 'UnitTests' for the class 'I18NFacade'. 18 | 19 | 20 | 21 | #### Enhancement 22 | 23 | 24 | 25 | #### Bug 26 | 27 | 28 | 29 | #### Documentation 30 | #23 [doc] Update the three example sections in the ReadMe. 31 | #22 [doc] Write basic sub-sections for the core classes. 32 | 33 | 34 | 35 | #### Refactoring 36 | #25 [api] Remove DefaultI18NValidator from I18NFacade. 37 | #24 [api] Refactore the 'getString()' methods to 'message()' from the interface I18NResourceBundle. 38 | 39 | 40 | 41 | #### Additional 42 | 43 | 44 | 45 | Greetings 46 | Naoghuman 47 | 48 | 49 | 50 | [//]: # (Issues which will be integrated in this release) 51 | 52 | 53 | 54 | [//]: # (Links) 55 | [Callable<String>]:https://docs.oracle.com/javase/8/docs/api/index.html?java/util/concurrent/Callable.html 56 | [JavaFX]:http://docs.oracle.com/javase/8/javase-clienttechnologies.htm 57 | [Maven]:http://maven.apache.org/ 58 | [NetBeans]:https://netbeans.org/ 59 | [StringBinding]:https://docs.oracle.com/javase/8/javafx/api/javafx/beans/binding/StringBinding.html 60 | -------------------------------------------------------------------------------- /concept/Concept_Basic-library-idea.txt: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- 2 | CONCEPT Basic library idea 3 | -------------------------------------------------------------------------------- 4 | DESCRIPTION 5 | This library should contain all functionalities which allowed the developer to 6 | bind i18n keys with values (defined in .properties files) to a locale, so the 7 | application is ready for multi languages. 8 | 9 | -------------------------------------------------------------------------------- 10 | Link 11 | - https://www.sothawo.com/2016/09/how-to-implement-a-javafx-ui-where-the-language-can-be-changed-dynamically/ 12 | - Use as reference 13 | - Create prototype like in the article. 14 | 15 | -------------------------------------------------------------------------------- 16 | I18nBuilder.create() 17 | .properties(StringFileWithPath) 18 | .defaultLocale(Locale) 19 | .supportedLocales(Locale...) 20 | .configure() 21 | 22 | I18nBuilder.create() 23 | .control(NodeControl) 24 | .text(String) 25 | .text(String, Object... args) 26 | .tooltip(String)//optional 27 | .bind(): StringBinding 28 | 29 | I18nProvider.getDefaultLocale() 30 | I18nProvider.getSupportedLocales() 31 | I18nProvider.getLocale() 32 | I18nProvider.setLocale(Locale) 33 | I18nProvider.localeProperty() 34 | I18nProvider.get(final String key, final Object... args): String 35 | 36 | ResourceBundle bundle = ResourceBundle.getBundle("messages", getLocale()); 37 | - Load only ones per locale. 38 | - Cache the loaded resource bundle in map. 39 | 40 | -------------------------------------------------------------------------------- 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | -------------------------------------------------------------------------------- /release/Release_v0.6.0_2018-11-23_00-59.md: -------------------------------------------------------------------------------- 1 | Welcome to `Lib-I18n` with the new release `0.6.0`. 2 | 3 | The library `Lib-I18N` allowed the developer to bind easly `.properties` key (values) 4 | to a [StringBinding]. So changing the language during runtime in a [JavaFX] application 5 | won't be a problem anymore. 6 | Lib-I18N is written in JavaFX, [Maven] and [NetBeans]. 7 | 8 | 9 | 10 | #### Summary 11 | * Add Unittests for all Builders in the core package. 12 | * Add more examples to the 'How to ...' section in the ReadMe. 13 | 14 | 15 | 16 | #### Feature 17 | #18 [test] Add 'UnitTests' for the 'XyBuilders' in 'core' package. 18 | 19 | 20 | 21 | #### Enhancement 22 | #33 [api] Add new method 'setSupportedLocales(Locale...) to I18NResourceBundle. 23 | 24 | 25 | 26 | #### Bug 27 | #40 [doc] Update link, JavaDoc in ReadMe. 28 | 29 | 30 | 31 | #### Documentation 32 | #41 [doc] Update the 'how to use' chapters mit Unittests examples. 33 | 34 | 35 | 36 | #### Refactoring 37 | #39 [pom] Test if '.xml' is needed into the section 'resources'. 38 | #37 [api] Rename I18NResourceBundleMessageBuilder to I18NMessageBuilder. 39 | #36 [doc] Update msg for the 'return' statement to next step in all builders. 40 | 41 | 42 | 43 | #### Additional 44 | 45 | 46 | 47 | Greetings 48 | Naoghuman 49 | 50 | 51 | 52 | [//]: # (Issues which will be integrated in this release) 53 | 54 | 55 | 56 | [//]: # (Links) 57 | [JavaFX]:http://docs.oracle.com/javase/8/javase-clienttechnologies.htm 58 | [Maven]:http://maven.apache.org/ 59 | [NetBeans]:https://netbeans.org/ 60 | [StringBinding]:https://docs.oracle.com/javase/8/javafx/api/javafx/beans/binding/StringBinding.html 61 | -------------------------------------------------------------------------------- /release/Release_v0.2.0-PRERELEASE_2018-11-06_02-22.md: -------------------------------------------------------------------------------- 1 | Welcome to `Lib-I18n` with the new release `0.2.0-PRERELEASE`. 2 | 3 | The library `Lib-I18N` allowed the developer to bind easly `.properties` key 4 | (values) to a [StringBinding] or [Callable<String>]. So changing the 5 | language during runtime in a [JavaFX] application won't be a problem anymore. 6 | Lib-I18N is written in JavaFX, [Maven] and [NetBeans]. 7 | 8 | 9 | 10 | #### Summary 11 | * Move the `prototype` content from `App-I18N-Demo` to `Lib-I18N`. 12 | * Start writing the ReadMe. 13 | 14 | 15 | 16 | #### Feature 17 | #11 [lib] Prepare the content from 'prototype4' for the library needs. 18 | #10 [lib] Move the final content from 'prototype4' from 'App-I18N-Demo' to this library. 19 | 20 | 21 | 22 | #### Enhancement 23 | 24 | 25 | 26 | #### Bug 27 | #13 [doc] Update the link for the 'Callable' in the ReadMe. 28 | 29 | 30 | 31 | #### Documentation 32 | #14 [doc] Update the library description. 33 | #12 [doc] Add basic chapter structure to the ReadMe. 34 | #6 [doc] Add topics and description to the GitHub project. 35 | 36 | 37 | 38 | #### Refactoring 39 | 40 | 41 | 42 | #### Additional 43 | 44 | 45 | 46 | Greetings 47 | Naoghuman 48 | 49 | 50 | 51 | [//]: # (Issues which will be integrated in this release) 52 | 53 | 54 | 55 | [//]: # (Links) 56 | [Callable<String>]:https://docs.oracle.com/javase/8/docs/api/index.html?java/util/concurrent/Callable.html 57 | [JavaFX]:http://docs.oracle.com/javase/8/javase-clienttechnologies.htm 58 | [Maven]:http://maven.apache.org/ 59 | [NetBeans]:https://netbeans.org/ 60 | [StringBinding]:https://docs.oracle.com/javase/8/javafx/api/javafx/beans/binding/StringBinding.html 61 | -------------------------------------------------------------------------------- /release/Release_v0.8.0_2019-04-28_13-36.md: -------------------------------------------------------------------------------- 1 | Welcome to `Lib-I18n` with the new release `0.8.0`. 2 | 3 | The library `Lib-I18N` allows a developer to bind a key-value pair of a`.properties` 4 | file to a [StringBinding]. This makes it very easy to change the language during 5 | runtime in a [JavaFX] application. 6 | Lib-I18N is written in JavaFX, [Maven] and [NetBeans]. 7 | 8 | 9 | 10 | #### Summary 11 | * Implement a demo which shows how easy an application becomes multilingual in 12 | four steps :smile: . 13 | * Extend the ReadMe with a new chapter 'Demo'. 14 | * Fix some minor bugs (test files are copied into the .jar file). 15 | 16 | 17 | 18 | #### Bug 19 | #89 [bug] Test log4j2.xml is copied into the jar file. 20 | #88 [bug] Test .properties files are copied in the jar file. 21 | 22 | 23 | 24 | #### Feature 25 | #92 [test] Implement 'about' into the demo application. 26 | #90 [test] Implement functionalities in the demo to switch the language during runtime. 27 | #86 [test] Create basic demo application structure. 28 | 29 | 30 | 31 | #### Enhancement 32 | 33 | 34 | 35 | #### Test 36 | 37 | 38 | 39 | #### Documentation 40 | #87 [doc] Add new section 'Demo'. 41 | #85 [doc] Switch the two sections 'Examples' and 'Features. 42 | 43 | 44 | 45 | #### Refactoring 46 | 47 | 48 | 49 | #### Additional 50 | 51 | 52 | 53 | Greetings 54 | Naoghuman 55 | 56 | 57 | 58 | [//]: # (Issues which will be integrated in this release) 59 | 60 | 61 | 62 | [//]: # (Links) 63 | [JavaFX]:http://docs.oracle.com/javase/8/javase-clienttechnologies.htm 64 | [Maven]:http://maven.apache.org/ 65 | [NetBeans]:https://netbeans.org/ 66 | [StringBinding]:https://docs.oracle.com/javase/8/javafx/api/javafx/beans/binding/StringBinding.html 67 | -------------------------------------------------------------------------------- /nbactions.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | run 5 | 6 | jar 7 | 8 | 9 | process-classes 10 | org.codehaus.mojo:exec-maven-plugin:1.2.1:exec 11 | 12 | 13 | -classpath %classpath ${packageClassName} 14 | java 15 | 16 | 17 | 18 | debug 19 | 20 | jar 21 | 22 | 23 | process-classes 24 | org.codehaus.mojo:exec-maven-plugin:1.2.1:exec 25 | 26 | 27 | -Xdebug -Xrunjdwp:transport=dt_socket,server=n,address=${jpda.address} -classpath %classpath ${packageClassName} 28 | java 29 | true 30 | 31 | 32 | 33 | profile 34 | 35 | jar 36 | 37 | 38 | process-classes 39 | org.codehaus.mojo:exec-maven-plugin:1.2.1:exec 40 | 41 | 42 | -classpath %classpath ${packageClassName} 43 | java 44 | 45 | 46 | 47 | -------------------------------------------------------------------------------- /release/Release_v0.5.0_2018-11-18_16-55.md: -------------------------------------------------------------------------------- 1 | Welcome to `Lib-I18n` with the new release `0.5.0`. 2 | 3 | The library `Lib-I18N` allowed the developer to bind easly `.properties` key (values) 4 | to a [StringBinding]. So changing the language during runtime in a [JavaFX] application 5 | won't be a problem anymore. 6 | Lib-I18N is written in JavaFX, [Maven] and [NetBeans]. 7 | 8 | 9 | 10 | #### Summary 11 | * Main point in this update is writing the JavaDoc for the package 'core'. 12 | * Update the 'api' section in the ReadMe. 13 | 14 | 15 | 16 | #### Feature 17 | 18 | 19 | 20 | #### Enhancement 21 | 22 | 23 | 24 | #### Bug 25 | 26 | 27 | 28 | #### Documentation 29 | #38 [doc] Add hint to the 'App-I18N-Demo' project into the section 'Intention'. 30 | #35 [doc] Update 'download' section in ReadMe. 31 | #32 [doc] Write the JavaDoc for the 'package-info' from the 'core' package. 32 | #31 [doc] Write the JavaDoc for the facade I18NFacade. 33 | #30 [doc] Write the JavaDoc for the builder I18NResourceBundleMessageBuilder. 34 | #29 [doc] Write the JavaDoc for the builder I18NResourceBundleBuilder. 35 | #28 [doc] Write the JavaDoc for the builder I18NBindingBuilder. 36 | #27 [doc] Write the JavaDoc for the interface I18NResourceBundle. 37 | #26 [doc] Write the JavaDoc for the interface I18NBinding. 38 | 39 | 40 | 41 | #### Refactoring 42 | #34 [doc] Update project description. 43 | 44 | 45 | 46 | #### Additional 47 | 48 | 49 | 50 | Greetings 51 | Naoghuman 52 | 53 | 54 | 55 | [//]: # (Issues which will be integrated in this release) 56 | 57 | 58 | 59 | [//]: # (Links) 60 | [JavaFX]:http://docs.oracle.com/javase/8/javase-clienttechnologies.htm 61 | [Maven]:http://maven.apache.org/ 62 | [NetBeans]:https://netbeans.org/ 63 | [StringBinding]:https://docs.oracle.com/javase/8/javafx/api/javafx/beans/binding/StringBinding.html 64 | -------------------------------------------------------------------------------- /src/test/java/com/github/naoghuman/lib/i18n/core/I18NFacadeTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2018 Naoghuman's dream 3 | * 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | package com.github.naoghuman.lib.i18n.core; 18 | 19 | import org.junit.After; 20 | import org.junit.Before; 21 | import org.junit.Test; 22 | import static org.junit.Assert.*; 23 | 24 | /** 25 | * UnitTests to test the facade {@link com.github.naoghuman.lib.i18n.core.I18NFacade}. 26 | *

27 | * Only the static methode {@link com.github.naoghuman.lib.i18n.core.I18NFacade#getDefault()} 28 | * will be test here. All other methods from the interfaces are tested with the 29 | * UnitTests in the internal package. 30 | * 31 | * @since 0.4.0-PRERELEASE 32 | * @version 0.4.0-PRERELEASE 33 | * @author Naoghuman 34 | * @see com.github.naoghuman.lib.i18n.core.I18NFacade 35 | */ 36 | public class I18NFacadeTest { 37 | 38 | public I18NFacadeTest() { 39 | } 40 | 41 | @Before 42 | public void setUp() { 43 | } 44 | 45 | @After 46 | public void tearDown() { 47 | } 48 | 49 | @Test 50 | public void getDefault() { 51 | assertNotNull(I18NFacade.getDefault()); 52 | } 53 | 54 | } 55 | -------------------------------------------------------------------------------- /src/main/java/com/github/naoghuman/lib/i18n/core/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2018 Naoghuman's dream 3 | * 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | /** 18 | * The {@code core} package from the library {@code Lib-I18N} contains all functionalities 19 | * to register a {@link java.util.ResourceBundle}, access the {@code values} from the 20 | * bundle over the {@code keys} with optional {@code arguments} and bind them through 21 | * a {@link javafx.beans.binding.StringBinding} to a {@link javafx.beans.property.StringProperty}. 22 | *

23 | * That means switching the {@code actual} {@link java.util.Locale} (see 24 | * {@link com.github.naoghuman.lib.i18n.core.I18NResourceBundle#actualLocaleProperty() } 25 | * for more information) will update automatically all binded {@code StringProperties}. 26 | * 27 | * @since 0.1.0-PRERELEASE 28 | * @version 0.6.1 29 | * @author Naoghuman 30 | * @see com.github.naoghuman.lib.i18n.core.I18NResourceBundle#actualLocaleProperty() 31 | * @see java.util.Locale 32 | * @see java.util.ResourceBundle 33 | * @see javafx.beans.binding.StringBinding 34 | * @see javafx.beans.property.StringProperty 35 | */ 36 | package com.github.naoghuman.lib.i18n.core; 37 | -------------------------------------------------------------------------------- /release/Release_v0.6.1_2018-12-08_18-45.md: -------------------------------------------------------------------------------- 1 | Welcome to `Lib-I18n` with the new release `0.6.1`. 2 | 3 | The library `Lib-I18N` allowed the developer to bind easly `.properties` key (values) 4 | to a [StringBinding]. So changing the language during runtime in a [JavaFX] application 5 | won't be a problem anymore. 6 | Lib-I18N is written in JavaFX, [Maven] and [NetBeans]. 7 | 8 | 9 | 10 | #### Summary 11 | * Update the `How to use the builder...` sections. 12 | * `JavaDoc` from the library is now online available: http://naoghuman.github.io/lib-i18n/apidocs 13 | 14 | 15 | 16 | #### Feature 17 | 18 | 19 | 20 | #### Enhancement 21 | 22 | 23 | 24 | #### Bug 25 | #52 [test] ERROR StatusLogger No log4j2 configuration file found. 26 | #49 [doc] Typo in ReadMe (section I18NMessageBuilder) - replace "throw" with "through". 27 | #48 [doc] Some @version in JavaDoc shows '0.5.0', should be '0.6.0'. 28 | #44 [bug] I18NBindingBuilder.java: Some input files use unchecked or unsafe operations. 29 | 30 | 31 | 32 | #### Documentation 33 | #54 [doc] Add screenshot from JavaDoc page for v0.6.1 to ReadMe. 34 | #51 [doc] Move the "api" section to new folder `docs`. 35 | #43 [doc] Add JavaDoc to the classes in the 'internal' package. 36 | 37 | 38 | 39 | #### Refactoring 40 | #50 [doc] Refactore the "How to..." sections in the ReadMe. Split the examples. 41 | #47 [doc] Refactore "Examples 'Usage from XY'" to "Specification: Usage of XY". 42 | #45 [doc] Update JavaDoc from the class DefaultI18NValidator. 43 | #46 [doc] Update section 'Documentation' in the ReadMe. 44 | 45 | 46 | 47 | #### Additional 48 | 49 | 50 | 51 | Greetings 52 | Naoghuman 53 | 54 | 55 | 56 | [//]: # (Issues which will be integrated in this release) 57 | 58 | 59 | 60 | [//]: # (Links) 61 | [JavaFX]:http://docs.oracle.com/javase/8/javase-clienttechnologies.htm 62 | [Maven]:http://maven.apache.org/ 63 | [NetBeans]:https://netbeans.org/ 64 | [StringBinding]:https://docs.oracle.com/javase/8/javafx/api/javafx/beans/binding/StringBinding.html 65 | -------------------------------------------------------------------------------- /concept/Concept_Convention_v0.7.0_2018-12-12.txt: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- 2 | CONCEPT New section 'Convention' in the ReadMe. 3 | -------------------------------------------------------------------------------- 4 | INTENTION 5 | In this paper I want describe the concept for the new section 'Convention' in the 6 | ReadMe. 7 | 8 | This new section should be added after the section 'Examples'. 9 | 10 | -------------------------------------------------------------------------------- 11 | SPECIFICATION 12 | __Convention__: 'baseBundleName' from ResourceBundle 13 | * If a ResourceBundle with the defined 'baseBundleName' can't be found a 14 | MissingResourceException will be thrown. 15 | 16 | __Convention__: 'Key not found' in ResourceBundle 17 | * If a key can't be found in the defined ResourceBundle then no 'MissingResourceException' 18 | will be thrown. Instead the String pattern '<key>' will returned. 19 | 20 | __Convention__: Defined supported Locales, default and actual Locale. 21 | * Supported Locales 22 | Defines all supported Locales in the momentary session. 23 | * Default Locale 24 | If the supported Locales doesn't contained the default Locale then the Locale#ENGLISH 25 | will be used instead. 26 | * Actual Locale 27 | If the upported Locales doesn't contained the actual Locale then the default Locale 28 | will be used instead. 29 | 30 | __Convention__: Basic validation 31 | * Every attributes in the builders and in all setters will be check against minimal 32 | preconditions with [DefaultI18NValidator]. 33 | * Getters attributs will only checked if they are initial only instantiate and not 34 | declarated. 35 | * For example a String will be validate if it's not NULL and not EMPTY. 36 | 37 | -------------------------------------------------------------------------------- 38 | LINKS 39 | - ... 40 | 41 | -------------------------------------------------------------------------------- 42 | EXTRAS 43 | 44 | -------------------------------------------------------------------------------- 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | -------------------------------------------------------------------------------- /src/test/resources/log4j2.xml: -------------------------------------------------------------------------------- 1 | 2 | 18 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | -------------------------------------------------------------------------------- /release/Release_v0.7.0_2018-12-29_21-21.md: -------------------------------------------------------------------------------- 1 | Welcome to `Lib-I18n` with the new release `0.7.0`. 2 | 3 | The library `Lib-I18N` allows a developer to bind a key-value pair of a`.properties` 4 | file to a [StringBinding]. This makes it very easy to change the language during 5 | runtime in a [JavaFX] application. 6 | Lib-I18N is written in JavaFX, [Maven] and [NetBeans]. 7 | 8 | 9 | 10 | #### Summary 11 | * Additional unit tests were added to increase the stability of the library. 12 | * Extend and update the documentation. Add new sections 'Conventions' and 'Features'. 13 | 14 | 15 | 16 | #### Feature 17 | 18 | 19 | 20 | #### Enhancement 21 | #67 [test] Add Unittests for 'defaultLocale' not exists in DefaultI18NResourceBundleTest. 22 | #66 [internal] Add new method 'requireResourceBundleExists(...)' to DefaultI18NValidator. 23 | #62 [test] Add Unittests for no ResourceBundle in DefaultI18NResourceBundle. 24 | #60 [internal] Update the class DefaultI18NResourceBundle for 'key-not-found'. 25 | #42 [test] Add Unittests for 'key-not-found' in DefaultI18NResourceBundle. 26 | 27 | 28 | 29 | #### Bug 30 | 31 | 32 | 33 | #### Documentation 34 | #72 [doc] Show screenshots from 'App-Yin-Yang' in the section 'Intention' from the ReadMe. 35 | #71 [doc] Update the library description in ReadMe and GitHub. 36 | #70 [doc] Write new section 'Features' in the ReadMe. 37 | #69 [doc] Write new section 'Conventions' in the ReadMe. 38 | #68 [doc] Update JavaDoc in 'docs/apidocs'. 39 | #65 [doc] Update commentary for setActualLocale in Unittests. 40 | #64 [doc] Update JavaDoc for 'baseBundleName' in I18NResourceBundle and I18NResourceBundleBuilder. 41 | #63 [doc] Update the specification in I18NResourceBundleBuilder. 42 | #59 [doc] Update the section 'Intention' in the ReadMe. 43 | #58 [doc] Write new concept for new section 'Features' in the ReadMe. 44 | #57 [doc] Add maven coordinates for Lib-Logger in the ReadMe. 45 | #56 [doc] Add template for a concept paper to the folder 'concept'. 46 | #55 [doc] Write new concept for new section 'Convention' in the ReadMe. 47 | #53 [doc] Check possibility to update `docs` folder if in pom.xml a `release` will done. 48 | 49 | 50 | 51 | #### Refactoring 52 | 53 | 54 | 55 | #### Additional 56 | 57 | 58 | 59 | Greetings 60 | Naoghuman 61 | 62 | 63 | 64 | [//]: # (Issues which will be integrated in this release) 65 | 66 | 67 | 68 | [//]: # (Links) 69 | [JavaFX]:http://docs.oracle.com/javase/8/javase-clienttechnologies.htm 70 | [Maven]:http://maven.apache.org/ 71 | [NetBeans]:https://netbeans.org/ 72 | [StringBinding]:https://docs.oracle.com/javase/8/javafx/api/javafx/beans/binding/StringBinding.html 73 | -------------------------------------------------------------------------------- /src/main/java/com/github/naoghuman/lib/i18n/internal/DefaultI18NBinding.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2018 Naoghuman's dream 3 | * 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | package com.github.naoghuman.lib.i18n.internal; 18 | 19 | import com.github.naoghuman.lib.i18n.core.I18NBinding; 20 | import com.github.naoghuman.lib.i18n.core.I18NFacade; 21 | import java.util.concurrent.Callable; 22 | import javafx.beans.binding.Bindings; 23 | import javafx.beans.binding.StringBinding; 24 | 25 | /** 26 | * The {@code default} implementation from the interface 27 | * {@link com.github.naoghuman.lib.i18n.core.I18NBinding}. 28 | *

29 | * Given {@code attributes} in the methods will be checked by 30 | * {@link com.github.naoghuman.lib.i18n.internal.DefaultI18NValidator}. 31 | * 32 | * @since 0.1.0-PRERELEASE 33 | * @version 0.6.1 34 | * @author Naoghuman 35 | * @see com.github.naoghuman.lib.i18n.core.I18NBinding 36 | * @see com.github.naoghuman.lib.i18n.internal.DefaultI18NValidator 37 | */ 38 | public final class DefaultI18NBinding implements I18NBinding { 39 | 40 | @Override 41 | public StringBinding createStringBinding(final String key) { 42 | DefaultI18NValidator.requireNonNullAndNotEmpty(key); 43 | 44 | return Bindings.createStringBinding(() -> I18NFacade.getDefault().getMessage(key), I18NFacade.getDefault().actualLocaleProperty()); 45 | } 46 | 47 | @Override 48 | public StringBinding createStringBinding(final String key, Object... arguments) { 49 | DefaultI18NValidator.requireNonNullAndNotEmpty(key); 50 | DefaultI18NValidator.requireNonNullAndNotEmpty(arguments); 51 | 52 | return Bindings.createStringBinding(() -> I18NFacade.getDefault().getMessage(key, arguments), I18NFacade.getDefault().actualLocaleProperty()); 53 | } 54 | 55 | @Override 56 | public StringBinding createStringBinding(Callable function) { 57 | DefaultI18NValidator.requireNonNull(function); 58 | 59 | return Bindings.createStringBinding(function, I18NFacade.getDefault().actualLocaleProperty()); 60 | } 61 | 62 | } 63 | -------------------------------------------------------------------------------- /concept/Concept_Features_v0.7.0_2018-12-27.txt: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- 2 | CONCEPT 3 | -------------------------------------------------------------------------------- 4 | INTENTION 5 | This new concept should describe the new section 'Features' in the ReadMe. 6 | 7 | Basicly the new section is a list from statements which describes the key points 8 | from this library. 9 | 10 | -------------------------------------------------------------------------------- 11 | SPECIFICATION 12 | 13 | Content 14 | * [Features](#Features) 15 | * [JavaDoc](#JavaDoc) 16 | * [Download](#Download) 17 | 18 | 19 | 20 | Features 21 | --- 22 | 23 | In this section I want list the many features from the library `Lib-I18N`: 24 | 25 | 1. The library `Lib-I18N` allowed the developer to bind a `.properties` pair (key 26 | / value) to a [StringBinding]. 27 | 2. Due to the conventions in this library (see previous section) the handling with 28 | the different main functionalities is very easy. 29 | 3. With the builder [I18NResourceBundleBuilder] the developer can configure the 30 | [ResourceBundle] which contains the `key - value` pairs which will then be bind 31 | to a [Locale]. 32 | 4. The builder [I18NBindingBuilder] let the developer create a [StringBinding]. The 33 | StringBinding can created with a function from type [Callable<String>] or 34 | with a .properties `key` and optional `arguments`. 35 | 5. To load a .properties `key` with optional `arguments` from the initialized 36 | [ResourceBundle] through the [I18NResourceBundleBuilder] the developer can use 37 | the builder [I18NMessageBuilder]. 38 | 6. Every `parameter` in all functionalities will be verified against minimal 39 | conditions with the internal validator [DefaultI18NValidator]. For example a 40 | `String` can't be `NULL` or `EMPTY`. 41 | 7. All functionalities from the classes in the `core` and `internal` packages are 42 | tested with `Unittests`. 43 | 8. The documentation is done very well with an extended `ReadMe` and well written 44 | [JavaDoc] commentaries. 45 | 9. The library is `open source` and licensed under [General Public License 3.0]. 46 | 10. `Lib-I18N` is a [JavaFX] 8 library. 47 | 11. The library is programmed with the IDE [NetBeans] as a [Maven] library. 48 | 12. The library can easily integrated in a foreign project over [Maven Central]. 49 | 13. During the connection from the project with `Travis CI` automatically a build 50 | is performed with every commit. 51 | 14. During the integration from different `badges` from `img.shield.io` the 52 | interested reader can easily inform himself about the `build` state, current 53 | release and which license is used for this library. 54 | 55 | [DefaultI18NValidator]:https://github.com/Naoghuman/lib-i18n/blob/master/src/main/java/com/github/naoghuman/lib/i18n/internal/DefaultI18NValidator.java 56 | 57 | -------------------------------------------------------------------------------- 58 | LINKS 59 | - ... 60 | 61 | -------------------------------------------------------------------------------- 62 | EXTRAS 63 | - ... 64 | 65 | -------------------------------------------------------------------------------- 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | -------------------------------------------------------------------------------- /docs/apidocs/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Lib-I18N 0.8.0 API 8 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | <noscript> 70 | <div>JavaScript is disabled on your browser.</div> 71 | </noscript> 72 | <h2>Frame Alert</h2> 73 | <p>This document is designed to be viewed using the frames feature. If you see this message, you are using a non-frame-capable web client. Link to <a href="overview-summary.html">Non-frame version</a>.</p> 74 | 75 | 76 | 77 | -------------------------------------------------------------------------------- /src/test/java/com/github/naoghuman/lib/i18n/DemoI18NStart.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2018 Naoghuman's dream 3 | * 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | package com.github.naoghuman.lib.i18n; 18 | 19 | import com.github.naoghuman.lib.fxml.core.FXMLView; 20 | import com.github.naoghuman.lib.i18n.core.I18NResourceBundleBuilder; 21 | import com.github.naoghuman.lib.logger.core.LoggerFacade; 22 | import java.util.Locale; 23 | import javafx.application.Application; 24 | import javafx.scene.Scene; 25 | import javafx.scene.layout.AnchorPane; 26 | import javafx.stage.Stage; 27 | 28 | /** 29 | * 30 | * @since 0.8.0 31 | * @version 0.8.0 32 | * @author Naoghuman 33 | */ 34 | public final class DemoI18NStart extends Application { 35 | 36 | /** 37 | * 38 | * @param args 39 | * @since 0.8.0 40 | * @version 0.8.0 41 | * @author Naoghuman 42 | */ 43 | public static void main(String[] args) { 44 | launch(args); 45 | } 46 | 47 | @Override 48 | public void init() throws Exception { 49 | super.init(); 50 | 51 | LoggerFacade.getDefault().info(this.getClass(), "DemoI18NStart#init()"); // NOI18N 52 | 53 | /** 54 | * Step one: 55 | * - Inject the library 'Lib-I18N' into your project. 56 | * - Create for every supported language a .properties file. 57 | */ 58 | 59 | /** 60 | * Step two: 61 | * - Register the ResourceBundle 62 | * - where 'supportedLocales' are corresponding to every .properties file 63 | * - and 'actualLocale' is the language which will shown first. 64 | */ 65 | I18NResourceBundleBuilder.configure() 66 | .baseBundleName("com.github.naoghuman.lib.i18n.demo_i18n") // NOI18N 67 | .supportedLocales(Locale.ENGLISH, Locale.FRENCH, Locale.GERMAN, Locale.ITALIAN) 68 | .defaultLocale(Locale.ENGLISH) 69 | .actualLocale(Locale.ENGLISH) 70 | .build(); 71 | } 72 | 73 | @Override 74 | public void start(final Stage primaryStage) throws Exception { 75 | LoggerFacade.getDefault().debug(this.getClass(), "DemoI18NStart#start(Stage)"); // NOI18N 76 | 77 | primaryStage.setTitle("Lib-I18N Demo: v0.8.0"); // NOI18N 78 | 79 | final FXMLView view = FXMLView.create(DemoI18NController.class); 80 | final Scene scene = new Scene(view.getRoot().orElse(new AnchorPane()), 960, 540); 81 | primaryStage.setScene(scene); 82 | 83 | primaryStage.show(); 84 | } 85 | 86 | } 87 | -------------------------------------------------------------------------------- /docs/apidocs/com/github/naoghuman/lib/i18n/core/package-frame.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | com.github.naoghuman.lib.i18n.core (Lib-I18N 0.8.0 API) 8 | 9 | 10 | 11 | 12 | 13 |

com.github.naoghuman.lib.i18n.core

14 | 39 | 40 | 41 | -------------------------------------------------------------------------------- /docs/apidocs/deprecated-list.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Deprecated List (Lib-I18N 0.8.0 API) 8 | 9 | 10 | 11 | 12 | 13 | 23 | 26 | 27 |
28 | 29 | 30 | 31 | 32 | 33 | 34 | 44 |
45 | 72 | 73 |
74 |

Deprecated API

75 |

Contents

76 |
77 | 78 |
79 | 80 | 81 | 82 | 83 | 84 | 85 | 95 |
96 | 123 | 124 |

Copyright © 2018–2019 Naoghuman's dream. All rights reserved.

125 | 126 | 127 | -------------------------------------------------------------------------------- /docs/apidocs/constant-values.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Constant Field Values (Lib-I18N 0.8.0 API) 8 | 9 | 10 | 11 | 12 | 13 | 23 | 26 | 27 |
28 | 29 | 30 | 31 | 32 | 33 | 34 | 44 |
45 | 72 | 73 |
74 |

Constant Field Values

75 |

Contents

76 |
77 | 78 |
79 | 80 | 81 | 82 | 83 | 84 | 85 | 95 |
96 | 123 | 124 |

Copyright © 2018–2019 Naoghuman's dream. All rights reserved.

125 | 126 | 127 | -------------------------------------------------------------------------------- /docs/apidocs/allclasses-noframe.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | All Classes (Lib-I18N 0.8.0 API) 8 | 9 | 10 | 11 | 12 | 13 |

All Classes

14 | 38 | 39 | 40 | -------------------------------------------------------------------------------- /src/test/java/com/github/naoghuman/lib/i18n/core/I18NMessageBuilderTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2018 Naoghuman's dream 3 | * 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | package com.github.naoghuman.lib.i18n.core; 18 | 19 | import java.util.Locale; 20 | import org.junit.After; 21 | import static org.junit.Assert.*; 22 | import org.junit.Before; 23 | import org.junit.Test; 24 | 25 | /** 26 | * UnitTests to test the fluent builder {@link com.github.naoghuman.lib.i18n.core.I18NMessageBuilder}. 27 | * 28 | * @since 0.6.0 29 | * @version 0.6.0 30 | * @author Naoghuman 31 | * @see com.github.naoghuman.lib.i18n.core.I18NMessageBuilder 32 | */ 33 | public class I18NMessageBuilderTest { 34 | 35 | public I18NMessageBuilderTest() { 36 | } 37 | 38 | @Before 39 | public void setUp() { 40 | } 41 | 42 | @After 43 | public void tearDown() { 44 | } 45 | 46 | @Test(expected = NullPointerException.class) 47 | public void firstStepThrowsNullPointerException() { 48 | I18NMessageBuilder.message() 49 | .key(null) 50 | .build(); 51 | } 52 | 53 | @Test(expected = IllegalArgumentException.class) 54 | public void firstStepThrowsIllegalArgumentException() { 55 | I18NMessageBuilder.message() 56 | .key("") 57 | .build(); 58 | } 59 | 60 | @Test(expected = NullPointerException.class) 61 | public void secondStepArrayThrowsNullPointerException() { 62 | final Object[] objects = null; 63 | I18NMessageBuilder.message() 64 | .key("imaginary.key") 65 | .arguments(objects) 66 | .build(); 67 | } 68 | 69 | @Test(expected = IllegalArgumentException.class) 70 | public void secondStepArrayThrowsIllegalArgumentException() { 71 | final Object[] objects = {}; 72 | I18NMessageBuilder.message() 73 | .key("imaginary.key") 74 | .arguments(objects) 75 | .build(); 76 | } 77 | 78 | @Test 79 | public void lastStepWithoutArguments() { 80 | I18NResourceBundleBuilder.configure() 81 | .baseBundleName("com.github.naoghuman.lib.i18n.internal.resourcebundle") 82 | .supportedLocales(Locale.ENGLISH, Locale.GERMAN) 83 | .defaultLocale(Locale.ENGLISH) 84 | .actualLocale(Locale.GERMAN) 85 | .build(); 86 | 87 | String result = I18NMessageBuilder.message() 88 | .key("resourcebundle.title") 89 | .build(); 90 | assertEquals("RB: Test Titel", result); 91 | 92 | I18NFacade.getDefault().setActualLocale(Locale.ENGLISH); // Here the magic happen :) 93 | result = I18NMessageBuilder.message() 94 | .key("resourcebundle.title") 95 | .build(); 96 | assertEquals("RB: Test title", result); 97 | } 98 | 99 | @Test 100 | public void lastStepWithArguments() { 101 | I18NResourceBundleBuilder.configure() 102 | .baseBundleName("com.github.naoghuman.lib.i18n.internal.resourcebundle") 103 | .supportedLocales(Locale.ENGLISH, Locale.GERMAN) 104 | .defaultLocale(Locale.ENGLISH) 105 | .actualLocale(Locale.GERMAN) 106 | .build(); 107 | 108 | String result = I18NMessageBuilder.message() 109 | .key("resourcebundle.label.with.parameter") 110 | .arguments(2) 111 | .build(); 112 | assertEquals("RB: Text mit Parameter: 2", result); 113 | 114 | I18NFacade.getDefault().setActualLocale(Locale.ENGLISH); // Here the magic happen :) 115 | result = I18NMessageBuilder.message() 116 | .key("resourcebundle.label.with.parameter") 117 | .arguments(123) 118 | .build(); 119 | assertEquals("RB: Text with parameter: 123", result); 120 | } 121 | 122 | } 123 | -------------------------------------------------------------------------------- /docs/apidocs/allclasses-frame.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | All Classes (Lib-I18N 0.8.0 API) 8 | 9 | 10 | 11 | 12 | 13 |

All Classes

14 | 38 | 39 | 40 | -------------------------------------------------------------------------------- /docs/apidocs/com/github/naoghuman/lib/i18n/internal/package-use.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Uses of Package com.github.naoghuman.lib.i18n.internal (Lib-I18N 0.8.0 API) 8 | 9 | 10 | 11 | 12 | 13 | 23 | 26 | 27 |
28 | 29 | 30 | 31 | 32 | 33 | 34 | 44 |
45 | 72 | 73 |
74 |

Uses of Package
com.github.naoghuman.lib.i18n.internal

75 |
76 |
No usage of com.github.naoghuman.lib.i18n.internal
77 | 78 |
79 | 80 | 81 | 82 | 83 | 84 | 85 | 95 |
96 | 123 | 124 |

Copyright © 2018–2019 Naoghuman's dream. All rights reserved.

125 | 126 | 127 | -------------------------------------------------------------------------------- /src/test/java/com/github/naoghuman/lib/i18n/internal/DefaultI18NValidatorTest.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2018 Naoghuman's dream 3 | * 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | package com.github.naoghuman.lib.i18n.internal; 18 | 19 | import java.util.Locale; 20 | import java.util.MissingResourceException; 21 | import javafx.collections.FXCollections; 22 | import javafx.collections.ObservableList; 23 | import org.junit.After; 24 | import static org.junit.Assert.*; 25 | import org.junit.Before; 26 | import org.junit.Test; 27 | 28 | /** 29 | * UnitTests to test the {@code Interface} {@link com.github.naoghuman.lib.i18n.core.I18NValidator} 30 | * with its default implementation {@link com.github.naoghuman.lib.i18n.internal.DefaultI18NValidator}. 31 | * 32 | * @since 0.2.0-PRERELEASE 33 | * @version 0.2.0-PRERELEASE 34 | * @author Naoghuman 35 | * @see com.github.naoghuman.lib.i18n.core.I18NValidator 36 | * @see com.github.naoghuman.lib.i18n.internal.DefaultI18NValidator 37 | */ 38 | public class DefaultI18NValidatorTest { 39 | 40 | public DefaultI18NValidatorTest() { 41 | } 42 | 43 | @Before 44 | public void setUp() { 45 | } 46 | 47 | @After 48 | public void tearDown() { 49 | } 50 | 51 | @Test 52 | public void isNullTrue() { 53 | String hello = null; 54 | assertTrue(DefaultI18NValidator.isNull(hello)); 55 | } 56 | 57 | @Test 58 | public void isNullFalse() { 59 | String hello = "hello"; 60 | assertFalse(DefaultI18NValidator.isNull(hello)); 61 | } 62 | 63 | @Test 64 | public void nonNullTrue() { 65 | String hello = "hello"; 66 | assertTrue(DefaultI18NValidator.nonNull(hello)); 67 | } 68 | 69 | @Test 70 | public void nonNullFalse() { 71 | String hello = null; 72 | assertFalse(DefaultI18NValidator.nonNull(hello)); 73 | } 74 | 75 | @Test 76 | public void requireNonNull() { 77 | String hello = "hello"; 78 | DefaultI18NValidator.requireNonNull(hello); 79 | } 80 | 81 | @Test(expected = NullPointerException.class) 82 | public void requireNonNullThrowsNullPointerException() { 83 | String hello = null; 84 | DefaultI18NValidator.requireNonNull(hello); 85 | } 86 | 87 | @Test 88 | public void requireNonNullAndNotEmptyString() { 89 | String hello = "hello"; 90 | DefaultI18NValidator.requireNonNullAndNotEmpty(hello); 91 | } 92 | 93 | @Test(expected = NullPointerException.class) 94 | public void requireNonNullAndNotEmptyStringThrowsNullPointerException() { 95 | String hello = null; 96 | DefaultI18NValidator.requireNonNullAndNotEmpty(hello); 97 | } 98 | 99 | @Test(expected = IllegalArgumentException.class) 100 | public void requireNonNullAndNotEmptyStringThrowsIllegalArgumentException() { 101 | String hello = ""; 102 | DefaultI18NValidator.requireNonNullAndNotEmpty(hello); 103 | } 104 | 105 | @Test 106 | public void requireNonNullAndNotEmptyObjectArray() { 107 | DefaultI18NValidator.requireNonNullAndNotEmpty("hello", "hi"); 108 | } 109 | 110 | @Test 111 | public void requireNonNullAndNotEmptyObservableList() { 112 | ObservableList list = FXCollections.observableArrayList(); 113 | list.addAll("hello", "hi"); 114 | DefaultI18NValidator.requireNonNullAndNotEmpty(list); 115 | } 116 | 117 | @Test(expected = NullPointerException.class) 118 | public void requireNonNullAndNotEmptyObservableListThrowsNullPointerException() { 119 | ObservableList list = null; 120 | DefaultI18NValidator.requireNonNullAndNotEmpty(list); 121 | } 122 | 123 | @Test(expected = IllegalArgumentException.class) 124 | public void requireNonNullAndNotEmptyObservableListThrowsIllegalArgumentException() { 125 | ObservableList list = FXCollections.observableArrayList(); 126 | DefaultI18NValidator.requireNonNullAndNotEmpty(list); 127 | } 128 | 129 | @Test(expected = MissingResourceException.class) 130 | public void requireResourceBundleExistThrowsMissingResourceException() { 131 | 132 | String notExistingBaseBundleName = "com.github.naoghuman.lib.i18n.internal.not-existing-resourcebundle"; // NOI18N 133 | Locale actualLocale = Locale.ENGLISH; 134 | 135 | DefaultI18NValidator.requireResourceBundleExist(notExistingBaseBundleName, actualLocale); 136 | } 137 | 138 | } 139 | -------------------------------------------------------------------------------- /docs/apidocs/com/github/naoghuman/lib/i18n/core/class-use/I18NBindingBuilder.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Uses of Class com.github.naoghuman.lib.i18n.core.I18NBindingBuilder (Lib-I18N 0.8.0 API) 8 | 9 | 10 | 11 | 12 | 13 | 23 | 26 | 27 |
28 | 29 | 30 | 31 | 32 | 33 | 34 | 44 |
45 | 72 | 73 |
74 |

Uses of Class
com.github.naoghuman.lib.i18n.core.I18NBindingBuilder

75 |
76 |
No usage of com.github.naoghuman.lib.i18n.core.I18NBindingBuilder
77 | 78 |
79 | 80 | 81 | 82 | 83 | 84 | 85 | 95 |
96 | 123 | 124 |

Copyright © 2018–2019 Naoghuman's dream. All rights reserved.

125 | 126 | 127 | -------------------------------------------------------------------------------- /docs/apidocs/com/github/naoghuman/lib/i18n/core/class-use/I18NMessageBuilder.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Uses of Class com.github.naoghuman.lib.i18n.core.I18NMessageBuilder (Lib-I18N 0.8.0 API) 8 | 9 | 10 | 11 | 12 | 13 | 23 | 26 | 27 |
28 | 29 | 30 | 31 | 32 | 33 | 34 | 44 |
45 | 72 | 73 |
74 |

Uses of Class
com.github.naoghuman.lib.i18n.core.I18NMessageBuilder

75 |
76 |
No usage of com.github.naoghuman.lib.i18n.core.I18NMessageBuilder
77 | 78 |
79 | 80 | 81 | 82 | 83 | 84 | 85 | 95 |
96 | 123 | 124 |

Copyright © 2018–2019 Naoghuman's dream. All rights reserved.

125 | 126 | 127 | -------------------------------------------------------------------------------- /docs/apidocs/com/github/naoghuman/lib/i18n/internal/class-use/DefaultI18NBinding.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Uses of Class com.github.naoghuman.lib.i18n.internal.DefaultI18NBinding (Lib-I18N 0.8.0 API) 8 | 9 | 10 | 11 | 12 | 13 | 23 | 26 | 27 |
28 | 29 | 30 | 31 | 32 | 33 | 34 | 44 |
45 | 72 | 73 |
74 |

Uses of Class
com.github.naoghuman.lib.i18n.internal.DefaultI18NBinding

75 |
76 |
No usage of com.github.naoghuman.lib.i18n.internal.DefaultI18NBinding
77 | 78 |
79 | 80 | 81 | 82 | 83 | 84 | 85 | 95 |
96 | 123 | 124 |

Copyright © 2018–2019 Naoghuman's dream. All rights reserved.

125 | 126 | 127 | -------------------------------------------------------------------------------- /docs/apidocs/com/github/naoghuman/lib/i18n/internal/class-use/DefaultI18NValidator.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Uses of Class com.github.naoghuman.lib.i18n.internal.DefaultI18NValidator (Lib-I18N 0.8.0 API) 8 | 9 | 10 | 11 | 12 | 13 | 23 | 26 | 27 |
28 | 29 | 30 | 31 | 32 | 33 | 34 | 44 |
45 | 72 | 73 |
74 |

Uses of Class
com.github.naoghuman.lib.i18n.internal.DefaultI18NValidator

75 |
76 |
No usage of com.github.naoghuman.lib.i18n.internal.DefaultI18NValidator
77 | 78 |
79 | 80 | 81 | 82 | 83 | 84 | 85 | 95 |
96 | 123 | 124 |

Copyright © 2018–2019 Naoghuman's dream. All rights reserved.

125 | 126 | 127 | -------------------------------------------------------------------------------- /docs/apidocs/com/github/naoghuman/lib/i18n/core/class-use/I18NResourceBundleBuilder.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Uses of Class com.github.naoghuman.lib.i18n.core.I18NResourceBundleBuilder (Lib-I18N 0.8.0 API) 8 | 9 | 10 | 11 | 12 | 13 | 23 | 26 | 27 |
28 | 29 | 30 | 31 | 32 | 33 | 34 | 44 |
45 | 72 | 73 |
74 |

Uses of Class
com.github.naoghuman.lib.i18n.core.I18NResourceBundleBuilder

75 |
76 |
No usage of com.github.naoghuman.lib.i18n.core.I18NResourceBundleBuilder
77 | 78 |
79 | 80 | 81 | 82 | 83 | 84 | 85 | 95 |
96 | 123 | 124 |

Copyright © 2018–2019 Naoghuman's dream. All rights reserved.

125 | 126 | 127 | -------------------------------------------------------------------------------- /docs/apidocs/com/github/naoghuman/lib/i18n/internal/class-use/DefaultI18NResourceBundle.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Uses of Class com.github.naoghuman.lib.i18n.internal.DefaultI18NResourceBundle (Lib-I18N 0.8.0 API) 8 | 9 | 10 | 11 | 12 | 13 | 23 | 26 | 27 |
28 | 29 | 30 | 31 | 32 | 33 | 34 | 44 |
45 | 72 | 73 |
74 |

Uses of Class
com.github.naoghuman.lib.i18n.internal.DefaultI18NResourceBundle

75 |
76 |
No usage of com.github.naoghuman.lib.i18n.internal.DefaultI18NResourceBundle
77 | 78 |
79 | 80 | 81 | 82 | 83 | 84 | 85 | 95 |
96 | 123 | 124 |

Copyright © 2018–2019 Naoghuman's dream. All rights reserved.

125 | 126 | 127 | -------------------------------------------------------------------------------- /src/test/java/com/github/naoghuman/lib/i18n/core/I18NBindingBuilderTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2018 Naoghuman's dream 3 | * 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | package com.github.naoghuman.lib.i18n.core; 18 | 19 | import java.util.Locale; 20 | import java.util.Optional; 21 | import javafx.beans.binding.StringBinding; 22 | import org.junit.After; 23 | import static org.junit.Assert.*; 24 | import org.junit.Before; 25 | import org.junit.Test; 26 | 27 | /** 28 | * UnitTests to test the fluent builder {@link com.github.naoghuman.lib.i18n.core.I18NBindingBuilder}. 29 | * 30 | * @since 0.6.0 31 | * @version 0.6.0 32 | * @author Naoghuman 33 | * @see com.github.naoghuman.lib.i18n.core.I18NBindingBuilder 34 | */ 35 | public class I18NBindingBuilderTest { 36 | 37 | public I18NBindingBuilderTest() { 38 | } 39 | 40 | @Before 41 | public void setUp() { 42 | } 43 | 44 | @After 45 | public void tearDown() { 46 | } 47 | 48 | @Test(expected = NullPointerException.class) 49 | public void firstStepCallableThrowsNullPointerException() { 50 | I18NBindingBuilder.bind() 51 | .callable(null) 52 | .build(); 53 | } 54 | 55 | @Test(expected = NullPointerException.class) 56 | public void firstStepKeyThrowsNullPointerException() { 57 | I18NBindingBuilder.bind() 58 | .key(null) 59 | .build(); 60 | } 61 | 62 | @Test(expected = IllegalArgumentException.class) 63 | public void firstStepKeyThrowsIllegalArgumentException() { 64 | I18NBindingBuilder.bind() 65 | .key("") 66 | .build(); 67 | } 68 | 69 | @Test(expected = NullPointerException.class) 70 | public void secondStepArgumentsThrowsNullPointerException() { 71 | final Object[] objects = null; 72 | I18NBindingBuilder.bind() 73 | .key("imaginary.key") 74 | .arguments(objects) 75 | .build(); 76 | } 77 | 78 | @Test(expected = IllegalArgumentException.class) 79 | public void secondStepArgumentsThrowsIllegalArgumentException() { 80 | final Object[] objects = {}; 81 | I18NBindingBuilder.bind() 82 | .key("imaginary.key") 83 | .arguments(objects) 84 | .build(); 85 | } 86 | 87 | @Test 88 | public void lastStepCallable() { 89 | I18NResourceBundleBuilder.configure() 90 | .baseBundleName("com.github.naoghuman.lib.i18n.internal.resourcebundle") 91 | .supportedLocales(Locale.ENGLISH, Locale.GERMAN) 92 | .defaultLocale(Locale.ENGLISH) 93 | .actualLocale(Locale.GERMAN) 94 | .build(); 95 | 96 | Optional result = I18NBindingBuilder.bind() 97 | .callable(() -> I18NMessageBuilder.message() 98 | .key("resourcebundle.title") 99 | .build() 100 | ) 101 | .build(); 102 | assertTrue(result.isPresent()); 103 | assertEquals("RB: Test Titel", result.get().get()); 104 | 105 | I18NFacade.getDefault().setActualLocale(Locale.ENGLISH); // Here the magic happen :) 106 | assertEquals("RB: Test title", result.get().get()); 107 | } 108 | 109 | @Test 110 | public void lastStepKeyWithoutArguments() { 111 | I18NResourceBundleBuilder.configure() 112 | .baseBundleName("com.github.naoghuman.lib.i18n.internal.resourcebundle") 113 | .supportedLocales(Locale.ENGLISH, Locale.GERMAN) 114 | .defaultLocale(Locale.ENGLISH) 115 | .actualLocale(Locale.GERMAN) 116 | .build(); 117 | 118 | Optional result = I18NBindingBuilder.bind() 119 | .key("resourcebundle.title") 120 | .build(); 121 | assertTrue(result.isPresent()); 122 | assertEquals("RB: Test Titel", result.get().get()); 123 | 124 | I18NFacade.getDefault().setActualLocale(Locale.ENGLISH); // Here the magic happen :) 125 | assertEquals("RB: Test title", result.get().get()); 126 | } 127 | 128 | @Test 129 | public void lastStepKeyWithArguments() { 130 | I18NResourceBundleBuilder.configure() 131 | .baseBundleName("com.github.naoghuman.lib.i18n.internal.resourcebundle") 132 | .supportedLocales(Locale.ENGLISH, Locale.GERMAN) 133 | .defaultLocale(Locale.ENGLISH) 134 | .actualLocale(Locale.GERMAN) 135 | .build(); 136 | 137 | Optional result = I18NBindingBuilder.bind() 138 | .key("resourcebundle.label.with.parameter") 139 | .arguments(123) 140 | .build(); 141 | assertTrue(result.isPresent()); 142 | assertEquals("RB: Text mit Parameter: 123", result.get().get()); 143 | 144 | I18NFacade.getDefault().setActualLocale(Locale.ENGLISH); // Here the magic happen :) 145 | assertEquals("RB: Text with parameter: 123", result.get().get()); 146 | } 147 | 148 | } 149 | -------------------------------------------------------------------------------- /docs/apidocs/overview-summary.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Overview (Lib-I18N 0.8.0 API) 8 | 9 | 10 | 11 | 12 | 13 | 23 | 26 | 27 |
28 | 29 | 30 | 31 | 32 | 33 | 34 | 44 |
45 | 72 | 73 |
74 |

Lib-I18N 0.8.0 API

75 |
76 |
77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 92 | 93 | 94 | 95 | 100 | 101 | 102 |
Packages 
PackageDescription
com.github.naoghuman.lib.i18n.core 87 |
The core package from the library Lib-I18N contains all functionalities 88 | to register a ResourceBundle, access the values from the 89 | bundle over the keys with optional arguments and bind them through 90 | a StringBinding to a StringProperty.
91 |
com.github.naoghuman.lib.i18n.internal 96 |
The internal package from the library Lib-I18N contains on the one side 97 | the default implementations from the interfaces from the library core package 98 | and on the other side a default validator for precondition checks.
99 |
103 |
104 | 105 |
106 | 107 | 108 | 109 | 110 | 111 | 112 | 122 |
123 | 150 | 151 |

Copyright © 2018–2019 Naoghuman's dream. All rights reserved.

152 | 153 | 154 | -------------------------------------------------------------------------------- /src/main/java/com/github/naoghuman/lib/i18n/core/I18NFacade.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2018 Naoghuman's dream 3 | * 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | package com.github.naoghuman.lib.i18n.core; 18 | 19 | import com.github.naoghuman.lib.i18n.internal.DefaultI18NBinding; 20 | import com.github.naoghuman.lib.i18n.internal.DefaultI18NResourceBundle; 21 | import java.util.Locale; 22 | import java.util.Optional; 23 | import java.util.concurrent.Callable; 24 | import javafx.beans.binding.StringBinding; 25 | import javafx.beans.property.ObjectProperty; 26 | import javafx.collections.ObservableList; 27 | 28 | /** 29 | * Over the facade {@code I18NFacade} the developer have access to all methods 30 | * from the interfaces {@link com.github.naoghuman.lib.i18n.core.I18NBinding} 31 | * and {@link com.github.naoghuman.lib.i18n.core.I18NResourceBundle}. 32 | *

33 | * The usage from the builders 34 | *

    35 | *
  • {@link com.github.naoghuman.lib.i18n.core.I18NResourceBundleBuilder}: 36 | * Allowed the developer to configure the {@link java.util.ResourceBundle}.
  • 37 | *
  • {@link com.github.naoghuman.lib.i18n.core.I18NBindingBuilder}: 38 | * Allowed the developer to create a {@link javafx.beans.binding.StringBinding}.
  • 39 | *
  • {@link com.github.naoghuman.lib.i18n.core.I18NMessageBuilder}: 40 | * Allowed the developer to access the messages from the bundle.
  • 41 | *
42 | *

43 | * is preferred. 44 | * 45 | * @since 0.1.0-PRERELEASE 46 | * @version 0.6.0 47 | * @author Naoghuman 48 | * @see com.github.naoghuman.lib.i18n.core.I18NBinding 49 | * @see com.github.naoghuman.lib.i18n.core.I18NBindingBuilder 50 | * @see com.github.naoghuman.lib.i18n.core.I18NMessageBuilder 51 | * @see com.github.naoghuman.lib.i18n.core.I18NResourceBundle 52 | * @see com.github.naoghuman.lib.i18n.core.I18NResourceBundleBuilder 53 | * @see java.util.ResourceBundle 54 | * @see javafx.beans.binding.StringBinding 55 | */ 56 | public final class I18NFacade implements I18NBinding, I18NResourceBundle { 57 | 58 | private static final Optional INSTANCE = Optional.of(new I18NFacade()); 59 | 60 | /** 61 | * Returns a {@code singleton} instance from this facade. 62 | * 63 | * @return a {@code singleton} instance from this facade. 64 | * @since 0.1.0-PRERELEASE 65 | * @version 0.6.0 66 | * @author Naoghuman 67 | */ 68 | public static I18NFacade getDefault() { 69 | return INSTANCE.get(); 70 | } 71 | 72 | private I18NBinding i18NBinding; 73 | private I18NResourceBundle i18NResourceBundle; 74 | 75 | private I18NFacade() { 76 | this.init(); 77 | } 78 | 79 | private void init() { 80 | i18NBinding = new DefaultI18NBinding(); 81 | i18NResourceBundle = new DefaultI18NResourceBundle(); 82 | } 83 | 84 | @Override 85 | public ObservableList getSupportedLocales() { 86 | return i18NResourceBundle.getSupportedLocales(); 87 | } 88 | 89 | @Override 90 | public void setSupportedLocales(final ObservableList locales) { 91 | i18NResourceBundle.setSupportedLocales(locales); 92 | } 93 | 94 | @Override 95 | public void setSupportedLocales(final Locale... locales) { 96 | i18NResourceBundle.setSupportedLocales(locales); 97 | } 98 | 99 | @Override 100 | public Locale getDefaultLocale() { 101 | return i18NResourceBundle.getDefaultLocale(); 102 | } 103 | 104 | @Override 105 | public void setDefaultLocale(final Locale locale) { 106 | i18NResourceBundle.setDefaultLocale(locale); 107 | } 108 | 109 | @Override 110 | public Locale getActualLocale() { 111 | return i18NResourceBundle.getActualLocale(); 112 | } 113 | 114 | @Override 115 | public void setActualLocale(final Locale locale) { 116 | i18NResourceBundle.setActualLocale(locale); 117 | } 118 | 119 | @Override 120 | public ObjectProperty actualLocaleProperty() { 121 | return i18NResourceBundle.actualLocaleProperty(); 122 | } 123 | 124 | @Override 125 | public StringBinding createStringBinding(final Callable function) { 126 | return i18NBinding.createStringBinding(function); 127 | } 128 | @Override 129 | public StringBinding createStringBinding(final String key) { 130 | return i18NBinding.createStringBinding(key); 131 | } 132 | 133 | @Override 134 | public StringBinding createStringBinding(final String key, Object... args) { 135 | return i18NBinding.createStringBinding(key, args); 136 | } 137 | 138 | @Override 139 | public String getBaseBundleName() { 140 | return i18NResourceBundle.getBaseBundleName(); 141 | } 142 | 143 | @Override 144 | public void setBaseBundleName(final String baseName) { 145 | i18NResourceBundle.setBaseBundleName(baseName); 146 | } 147 | 148 | @Override 149 | public String getMessage(final String key) { 150 | return i18NResourceBundle.getMessage(key); 151 | } 152 | 153 | @Override 154 | public String getMessage(final String key, final Object... args) { 155 | return i18NResourceBundle.getMessage(key, args); 156 | } 157 | 158 | } 159 | -------------------------------------------------------------------------------- /src/test/java/com/github/naoghuman/lib/i18n/DemoI18NController.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2018 Naoghuman's dream 3 | * 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | package com.github.naoghuman.lib.i18n; 18 | 19 | import com.github.naoghuman.lib.fxml.core.FXMLController; 20 | import com.github.naoghuman.lib.i18n.core.I18NBindingBuilder; 21 | import com.github.naoghuman.lib.i18n.core.I18NFacade; 22 | import com.github.naoghuman.lib.logger.core.LoggerFacade; 23 | import java.net.URL; 24 | import java.util.Locale; 25 | import java.util.Optional; 26 | import java.util.ResourceBundle; 27 | import javafx.beans.binding.StringBinding; 28 | import javafx.beans.property.StringProperty; 29 | import javafx.fxml.FXML; 30 | import javafx.fxml.Initializable; 31 | import javafx.scene.control.Button; 32 | import javafx.scene.control.Label; 33 | import javafx.scene.text.Text; 34 | 35 | /** 36 | * 37 | * @since 0.8.0 38 | * @version 0.8.0 39 | * @author Naoghuman 40 | */ 41 | public final class DemoI18NController extends FXMLController implements Initializable { 42 | 43 | @FXML private Button bFrench; 44 | @FXML private Button bGerman; 45 | @FXML private Button bItalian; 46 | @FXML private Button bEnglish; 47 | @FXML private Label lLanguages; 48 | @FXML private Text tAbout; 49 | @FXML private Text tFrom; 50 | @FXML private Text tHello; 51 | @FXML private Text tLand; 52 | 53 | @Override 54 | public void initialize(final URL location, final ResourceBundle resources) { 55 | LoggerFacade.getDefault().info(this.getClass(), "DemoI18NController#initialize(URL, ResourceBundle)"); // NOI18N 56 | 57 | /** 58 | * Step three: 59 | * - Bind the text components to the depending key from the ResourceBundle. 60 | */ 61 | // Menu 62 | this.bind(lLanguages.textProperty(), "demo.i18n.languages"); // NOI18N 63 | this.bind(bFrench.textProperty(), "demo.i18n.language.french"); // NOI18N 64 | this.bind(bGerman.textProperty(), "demo.i18n.language.german"); // NOI18N 65 | this.bind(bItalian.textProperty(), "demo.i18n.language.italian"); // NOI18N 66 | this.bind(bEnglish.textProperty(), "demo.i18n.language.english"); // NOI18N 67 | 68 | // Message 69 | this.bind(tHello.textProperty(), "demo.i18n.greetings"); // NOI18N 70 | this.bind(tFrom.textProperty(), "demo.i18n.from"); // NOI18N 71 | this.bind(tLand.textProperty(), "demo.i18n.land"); // NOI18N 72 | this.bind(tAbout.textProperty(), "demo.i18n.about"); // NOI18N 73 | } 74 | 75 | private void bind(final StringProperty stringProperty, final String key) { 76 | LoggerFacade.getDefault().debug(this.getClass(), String.format( 77 | "DemoI18NController#bind(StringProperty, String='%s')", key)); // NOI18N 78 | 79 | final Optional optionalStringBinding = I18NBindingBuilder.bind().key(key).build(); 80 | optionalStringBinding.ifPresent(stringBinding -> { 81 | stringProperty.bind(stringBinding); 82 | }); 83 | } 84 | 85 | /** 86 | * Step four: 87 | * - Change the 'actualLocale' depending from the user chooses... 88 | * - which will do then the magic :) . 89 | */ 90 | public void onActionSwitchToLanguageFrench() { 91 | LoggerFacade.getDefault().debug(this.getClass(), "DemoI18NController#onActionSwitchToLanguageFrench()"); // NOI18N 92 | 93 | if (I18NFacade.getDefault().getActualLocale().equals(Locale.FRENCH)) { 94 | LoggerFacade.getDefault().debug(this.getClass(), "Shows already the Locale.FRENCH - do nothing."); // NOI18N 95 | return; 96 | } 97 | 98 | I18NFacade.getDefault().setActualLocale(Locale.FRENCH); 99 | } 100 | 101 | public void onActionSwitchToLanguageGerman() { 102 | LoggerFacade.getDefault().debug(this.getClass(), "DemoI18NController#onActionSwitchToLanguageGerman()"); // NOI18N 103 | 104 | if (I18NFacade.getDefault().getActualLocale().equals(Locale.GERMAN)) { 105 | LoggerFacade.getDefault().debug(this.getClass(), "Shows already the Locale.GERMAN - do nothing."); // NOI18N 106 | return; 107 | } 108 | 109 | I18NFacade.getDefault().setActualLocale(Locale.GERMAN); 110 | } 111 | 112 | public void onActionSwitchToLanguageItalian() { 113 | LoggerFacade.getDefault().debug(this.getClass(), "DemoI18NController#onActionSwitchToLanguageItalian()"); // NOI18N 114 | 115 | if (I18NFacade.getDefault().getActualLocale().equals(Locale.ITALIAN)) { 116 | LoggerFacade.getDefault().debug(this.getClass(), "Shows already the Locale.ITALIAN - do nothing."); // NOI18N 117 | return; 118 | } 119 | 120 | I18NFacade.getDefault().setActualLocale(Locale.ITALIAN); 121 | } 122 | 123 | public void onActionSwitchToLanguageEnglish() { 124 | LoggerFacade.getDefault().debug(this.getClass(), "DemoI18NController#onActionSwitchToLanguageEnglish()"); // NOI18N 125 | 126 | if (I18NFacade.getDefault().getActualLocale().equals(Locale.ENGLISH)) { 127 | LoggerFacade.getDefault().debug(this.getClass(), "Shows already the Locale.ENGLISH - do nothing."); // NOI18N 128 | return; 129 | } 130 | 131 | I18NFacade.getDefault().setActualLocale(Locale.ENGLISH); 132 | } 133 | 134 | } 135 | -------------------------------------------------------------------------------- /src/main/java/com/github/naoghuman/lib/i18n/core/I18NBinding.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2018 Naoghuman's dream 3 | * 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | package com.github.naoghuman.lib.i18n.core; 18 | 19 | import java.util.concurrent.Callable; 20 | import javafx.beans.binding.StringBinding; 21 | 22 | /** 23 | * This {@code Interface} gives the developer the possibilities to create a 24 | * {@link javafx.beans.binding.StringBinding} which is associated with a 25 | * {@code key / value} pair from a {@link java.util.ResourceBundle}. 26 | *

27 | * To associated a {@code key} with a {@code StringBinding} the developer can use 28 | * on the one side the methods which will expected directly a {@code key} (with 29 | * optional {@code arguments}) or on the other side a {@link java.util.concurrent.Callable} 30 | * which computes then the message. 31 | *

32 | * The preferred way to used the methods from this interface is the usage from the 33 | * builder {@link com.github.naoghuman.lib.i18n.core.I18NBindingBuilder}.
34 | * An other option for advanced developers is the facade 35 | * {@link com.github.naoghuman.lib.i18n.core.I18NFacade}. 36 | * 37 | * @since 0.1.0-PRERELEASE 38 | * @version 0.6.1 39 | * @author Naoghuman 40 | * @see com.github.naoghuman.lib.i18n.core.I18NBindingBuilder 41 | * @see com.github.naoghuman.lib.i18n.core.I18NFacade 42 | * @see java.util.ResourceBundle 43 | * @see java.util.concurrent.Callable 44 | * @see javafx.beans.binding.StringBinding 45 | */ 46 | public interface I18NBinding { 47 | 48 | /** 49 | * Creates a {@link javafx.beans.binding.StringBinding} to a localized String 50 | * that is computed by calling the given {@code function}. 51 | *

52 | * Internal the {@code StringBinding} will be created with 53 | * {@link javafx.beans.binding.Bindings#createStringBinding(java.util.concurrent.Callable, javafx.beans.Observable...) } 54 | * where the {@code Observable} is a {@link com.github.naoghuman.lib.i18n.core.I18NFacade#actualLocaleProperty() }. 55 | * 56 | * @param function which should be used to create the {@code StringBinding}. 57 | * @return the created {@code StringBinding}. 58 | * @throws NullPointerException if {@code function} is NULL. 59 | * @since 0.1.0-PRERELEASE 60 | * @version 0.6.1 61 | * @author Naoghuman 62 | * @see com.github.naoghuman.lib.i18n.core.I18NFacade#actualLocaleProperty() 63 | * @see java.util.concurrent.Callable 64 | * @see javafx.beans.Observable 65 | * @see javafx.beans.binding.Bindings#createStringBinding(java.util.concurrent.Callable, javafx.beans.Observable...) 66 | * @see javafx.beans.binding.StringBinding 67 | */ 68 | public StringBinding createStringBinding(final Callable function); 69 | 70 | /** 71 | * Creates a {@link javafx.beans.binding.StringBinding} to a localized String 72 | * that is computed by calling the given {@code key}. 73 | *

74 | * Internal the {@code StringBinding} will be created with 75 | * {@link javafx.beans.binding.Bindings#createStringBinding(java.util.concurrent.Callable, javafx.beans.Observable...) } 76 | * where the {@code Observable} is a {@link com.github.naoghuman.lib.i18n.core.I18NFacade#actualLocaleProperty() }. 77 | * 78 | * @param key which should be used to load the associated {@code value}. 79 | * @return the created {@code StringBinding}. 80 | * @throws NullPointerException if {@code key} is NULL. 81 | * @throws IllegalArgumentException if {@code key} is EMPTY. 82 | * @since 0.1.0-PRERELEASE 83 | * @version 0.6.1 84 | * @author Naoghuman 85 | * @see com.github.naoghuman.lib.i18n.core.I18NFacade#actualLocaleProperty() 86 | * @see java.util.concurrent.Callable 87 | * @see javafx.beans.Observable 88 | * @see javafx.beans.binding.Bindings#createStringBinding(java.util.concurrent.Callable, javafx.beans.Observable...) 89 | * @see javafx.beans.binding.StringBinding 90 | */ 91 | public StringBinding createStringBinding(final String key); 92 | 93 | /** 94 | * Creates a {@link javafx.beans.binding.StringBinding} to a localized String 95 | * that is computed by calling the given {@code key} and the {@code arguments}. 96 | *

97 | * Internal the {@code StringBinding} will be created with 98 | * {@link javafx.beans.binding.Bindings#createStringBinding(java.util.concurrent.Callable, javafx.beans.Observable...) } 99 | * where the {@code Observable} is a {@link com.github.naoghuman.lib.i18n.core.I18NFacade#actualLocaleProperty() }. 100 | * 101 | * @param key which should be used to load the associated {code value}. 102 | * @param arguments which should be injected into the associated {code value}. 103 | * @return the created {@code StringBinding}. 104 | * @throws NullPointerException if ({@code key} || {@code arguments}) is NULL. 105 | * @throws IllegalArgumentException if ({@code key} || {@code arguments}) is EMPTY. 106 | * @since 0.1.0-PRERELEASE 107 | * @version 0.6.1 108 | * @author Naoghuman 109 | * @see com.github.naoghuman.lib.i18n.core.I18NFacade#actualLocaleProperty() 110 | * @see java.util.concurrent.Callable 111 | * @see javafx.beans.Observable 112 | * @see javafx.beans.binding.Bindings#createStringBinding(java.util.concurrent.Callable, javafx.beans.Observable...) 113 | * @see javafx.beans.binding.StringBinding 114 | */ 115 | public StringBinding createStringBinding(final String key, final Object... arguments); 116 | 117 | } 118 | -------------------------------------------------------------------------------- /docs/apidocs/com/github/naoghuman/lib/i18n/internal/package-tree.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | com.github.naoghuman.lib.i18n.internal Class Hierarchy (Lib-I18N 0.8.0 API) 8 | 9 | 10 | 11 | 12 | 13 | 23 |

JavaScript is disabled on your browser.
25 | 26 | 27 |
28 | 29 | 30 | 31 | 32 | 33 | 34 | 44 |
45 | 72 | 73 |
74 |

Hierarchy For Package com.github.naoghuman.lib.i18n.internal

75 | Package Hierarchies: 76 | 79 |
80 |
81 |

Class Hierarchy

82 | 91 |
92 | 93 |
94 | 95 | 96 | 97 | 98 | 99 | 100 | 110 |
111 | 138 | 139 |

Copyright © 2018–2019 Naoghuman's dream. All rights reserved.

140 | 141 | 142 | -------------------------------------------------------------------------------- /src/test/java/com/github/naoghuman/lib/i18n/internal/DefaultI18NBindingTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2018 Naoghuman's dream 3 | * 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | package com.github.naoghuman.lib.i18n.internal; 18 | 19 | import com.github.naoghuman.lib.i18n.core.I18NBinding; 20 | import com.github.naoghuman.lib.i18n.core.I18NFacade; 21 | import java.util.Locale; 22 | import java.util.concurrent.Callable; 23 | import javafx.beans.binding.StringBinding; 24 | import javafx.collections.FXCollections; 25 | import javafx.collections.ObservableList; 26 | import org.junit.After; 27 | import static org.junit.Assert.*; 28 | import org.junit.Before; 29 | import org.junit.Test; 30 | 31 | /** 32 | * UnitTests to test the {@code Interface} {@link com.github.naoghuman.lib.i18n.core.I18NBinding} 33 | * with its default implementation {@link com.github.naoghuman.lib.i18n.internal.DefaultI18NBinding}. 34 | * 35 | * @since 0.2.0-PRERELEASE 36 | * @version 0.2.0-PRERELEASE 37 | * @author Naoghuman 38 | * @see com.github.naoghuman.lib.i18n.core.I18NBinding 39 | * @see com.github.naoghuman.lib.i18n.internal.DefaultI18NBinding 40 | */ 41 | public class DefaultI18NBindingTest { 42 | 43 | private static final String RESOURCE_BUNDLE = "com.github.naoghuman.lib.i18n.internal.binding"; // NOI18N 44 | 45 | public DefaultI18NBindingTest() { 46 | } 47 | 48 | @Before 49 | public void setUp() { 50 | } 51 | 52 | @After 53 | public void tearDown() { 54 | } 55 | 56 | @Test 57 | public void createStringBinding_String() { 58 | I18NFacade.getDefault().setBaseBundleName(RESOURCE_BUNDLE); 59 | 60 | ObservableList supportedLocales = FXCollections.observableArrayList(); 61 | supportedLocales.addAll(Locale.ENGLISH, Locale.GERMAN); 62 | I18NFacade.getDefault().setSupportedLocales(supportedLocales); 63 | 64 | I18NBinding b = new DefaultI18NBinding(); 65 | I18NFacade.getDefault().setActualLocale(Locale.ENGLISH); // Here the magic happen :) 66 | StringBinding sb = b.createStringBinding("binding.title"); 67 | assertNotNull(sb); 68 | assertEquals("B: Test title", sb.get()); 69 | 70 | I18NFacade.getDefault().setActualLocale(Locale.GERMAN); // Here the magic happen :) 71 | sb = b.createStringBinding("binding.title"); 72 | assertNotNull(sb); 73 | assertEquals("B: Test Titel", sb.get()); 74 | } 75 | 76 | @Test(expected = NullPointerException.class) 77 | public void createStringBinding_String_ThrowsNullPointerException() { 78 | I18NBinding b = new DefaultI18NBinding(); 79 | String key = null; 80 | b.createStringBinding(key); 81 | } 82 | 83 | @Test(expected = IllegalArgumentException.class) 84 | public void createStringBinding_String_ThrowsIllegalArgumentException() { 85 | I18NBinding b = new DefaultI18NBinding(); 86 | b.createStringBinding(""); 87 | } 88 | 89 | @Test 90 | public void createStringBinding_String_ObjectArray() { 91 | I18NFacade.getDefault().setBaseBundleName(RESOURCE_BUNDLE); 92 | 93 | ObservableList supportedLocales = FXCollections.observableArrayList(); 94 | supportedLocales.addAll(Locale.ENGLISH, Locale.GERMAN); 95 | I18NFacade.getDefault().setSupportedLocales(supportedLocales); 96 | 97 | I18NBinding b = new DefaultI18NBinding(); 98 | I18NFacade.getDefault().setActualLocale(Locale.ENGLISH); // Here the magic happen :) 99 | StringBinding sb = b.createStringBinding("binding.label.with.parameter", 2); 100 | assertNotNull(sb); 101 | assertEquals("B: Text with parameter: 2", sb.get()); 102 | 103 | I18NFacade.getDefault().setActualLocale(Locale.GERMAN); // Here the magic happen :) 104 | sb = b.createStringBinding("binding.label.with.parameter", 5); 105 | assertNotNull(sb); 106 | assertEquals("B: Text mit Parameter: 5", sb.get()); 107 | } 108 | 109 | @Test(expected = NullPointerException.class) 110 | public void createStringBinding_String_ObjectArr_StringThrowsNullPointerException() { 111 | I18NBinding b = new DefaultI18NBinding(); 112 | b.createStringBinding(null, "hello"); 113 | } 114 | 115 | @Test(expected = IllegalArgumentException.class) 116 | public void createStringBinding_String_ObjectArr_StringThrowsIllegalArgumentException() { 117 | I18NBinding b = new DefaultI18NBinding(); 118 | b.createStringBinding("", "hello"); 119 | } 120 | 121 | // @Test(expected = NullPointerException.class) 122 | // public void createStringBinding_String_ObjectArr_ObjectArrThrowsNullPointerException() { 123 | // I18NBinding b = new DefaultI18NBinding(); 124 | // String parameter = null; 125 | // b.createStringBinding("hello", parameter); 126 | // } 127 | 128 | @Test 129 | public void createStringBinding_Callable() { 130 | I18NFacade.getDefault().setBaseBundleName(RESOURCE_BUNDLE); 131 | 132 | ObservableList supportedLocales = FXCollections.observableArrayList(); 133 | supportedLocales.addAll(Locale.ENGLISH, Locale.GERMAN); 134 | I18NFacade.getDefault().setSupportedLocales(supportedLocales); 135 | 136 | I18NBinding b = new DefaultI18NBinding(); 137 | I18NFacade.getDefault().setActualLocale(Locale.ENGLISH); // Here the magic happen :) 138 | StringBinding sb = b.createStringBinding(() -> I18NFacade.getDefault().getMessage("binding.label.with.parameter", 1)); 139 | assertNotNull(sb); 140 | assertEquals("B: Text with parameter: 1", sb.get()); 141 | 142 | I18NFacade.getDefault().setActualLocale(Locale.GERMAN); // Here the magic happen :) 143 | sb = b.createStringBinding(() -> I18NFacade.getDefault().getMessage("binding.label.with.parameter", 3)); 144 | assertNotNull(sb); 145 | assertEquals("B: Text mit Parameter: 3", sb.get()); 146 | } 147 | 148 | @Test(expected = NullPointerException.class) 149 | public void createStringBinding_Callable_ThrowsNullPointerException() { 150 | I18NBinding b = new DefaultI18NBinding(); 151 | Callable function = null; 152 | b.createStringBinding(function); 153 | } 154 | 155 | } 156 | -------------------------------------------------------------------------------- /src/test/resources/com/github/naoghuman/lib/i18n/demoi18n.fxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 29 | 44 | 59 | 74 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | -------------------------------------------------------------------------------- /src/test/java/com/github/naoghuman/lib/i18n/core/I18NResourceBundleBuilderTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2018 Naoghuman's dream 3 | * 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | package com.github.naoghuman.lib.i18n.core; 18 | 19 | import java.util.Locale; 20 | import javafx.collections.FXCollections; 21 | import javafx.collections.ObservableList; 22 | import org.junit.After; 23 | import org.junit.Before; 24 | import org.junit.Test; 25 | import static org.junit.Assert.*; 26 | 27 | /** 28 | * UnitTests to test the fluent builder {@link com.github.naoghuman.lib.i18n.core.I18NResourceBundleBuilder}. 29 | * 30 | * @since 0.6.0 31 | * @version 0.6.0 32 | * @author Naoghuman 33 | * @see com.github.naoghuman.lib.i18n.core.I18NResourceBundleBuilder 34 | */ 35 | public class I18NResourceBundleBuilderTest { 36 | 37 | public I18NResourceBundleBuilderTest() { 38 | } 39 | 40 | @Before 41 | public void setUp() { 42 | } 43 | 44 | @After 45 | public void tearDown() { 46 | } 47 | 48 | @Test(expected = NullPointerException.class) 49 | public void firstStepThrowsNullPointerException() { 50 | I18NResourceBundleBuilder.configure() 51 | .baseBundleName(null) 52 | .supportedLocales(Locale.ITALIAN) 53 | .defaultLocale(Locale.ITALIAN) 54 | .actualLocale(Locale.ITALIAN) 55 | .build(); 56 | } 57 | 58 | @Test(expected = IllegalArgumentException.class) 59 | public void firstStepThrowsIllegalArgumentException() { 60 | I18NResourceBundleBuilder.configure() 61 | .baseBundleName("") 62 | .supportedLocales(Locale.ITALIAN) 63 | .defaultLocale(Locale.ITALIAN) 64 | .actualLocale(Locale.ITALIAN) 65 | .build(); 66 | } 67 | 68 | @Test(expected = NullPointerException.class) 69 | public void secondStepArrayThrowsNullPointerException() { 70 | final Locale[] locales = null; 71 | I18NResourceBundleBuilder.configure() 72 | .baseBundleName("com.github.naoghuman.lib.i18n.internal.resourcebundle") 73 | .supportedLocales(locales) 74 | .defaultLocale(Locale.ITALIAN) 75 | .actualLocale(Locale.ITALIAN) 76 | .build(); 77 | } 78 | 79 | @Test(expected = IllegalArgumentException.class) 80 | public void secondStepArrayThrowsIllegalArgumentException() { 81 | final Locale[] locales = {}; 82 | I18NResourceBundleBuilder.configure() 83 | .baseBundleName("com.github.naoghuman.lib.i18n.internal.resourcebundle") 84 | .supportedLocales(locales) 85 | .defaultLocale(Locale.ITALIAN) 86 | .actualLocale(Locale.ITALIAN) 87 | .build(); 88 | } 89 | 90 | @Test(expected = NullPointerException.class) 91 | public void secondStepObservableListThrowsNullPointerException() { 92 | final ObservableList locales = null; 93 | I18NResourceBundleBuilder.configure() 94 | .baseBundleName("com.github.naoghuman.lib.i18n.internal.resourcebundle") 95 | .supportedLocales(locales) 96 | .defaultLocale(Locale.ITALIAN) 97 | .actualLocale(Locale.ITALIAN) 98 | .build(); 99 | } 100 | 101 | @Test(expected = IllegalArgumentException.class) 102 | public void secondStepObservableListThrowsIllegalArgumentException() { 103 | final ObservableList locales = FXCollections.observableArrayList(); 104 | I18NResourceBundleBuilder.configure() 105 | .baseBundleName("com.github.naoghuman.lib.i18n.internal.resourcebundle") 106 | .supportedLocales(locales) 107 | .defaultLocale(Locale.ITALIAN) 108 | .actualLocale(Locale.ITALIAN) 109 | .build(); 110 | } 111 | 112 | @Test(expected = NullPointerException.class) 113 | public void thirdStepThrowsNullPointerException() { 114 | I18NResourceBundleBuilder.configure() 115 | .baseBundleName("com.github.naoghuman.lib.i18n.internal.resourcebundle") 116 | .supportedLocales(Locale.ITALIAN, Locale.JAPANESE) 117 | .defaultLocale(null) 118 | .actualLocale(Locale.ITALIAN) 119 | .build(); 120 | } 121 | 122 | @Test(expected = NullPointerException.class) 123 | public void forthStepThrowsNullPointerException() { 124 | I18NResourceBundleBuilder.configure() 125 | .baseBundleName("com.github.naoghuman.lib.i18n.internal.resourcebundle") 126 | .supportedLocales(Locale.ITALIAN, Locale.JAPANESE) 127 | .defaultLocale(Locale.ITALIAN) 128 | .actualLocale(null) 129 | .build(); 130 | } 131 | 132 | @Test 133 | public void lastStepWithSupportedLocalesAsArray() { 134 | String resourcbundle = "com.github.naoghuman.lib.i18n.internal.resourcebundle"; 135 | I18NResourceBundleBuilder.configure() 136 | .baseBundleName(resourcbundle) 137 | .supportedLocales(Locale.ITALIAN, Locale.JAPANESE) 138 | .defaultLocale(Locale.ITALIAN) 139 | .actualLocale(Locale.JAPANESE) 140 | .build(); 141 | 142 | assertEquals(resourcbundle, I18NFacade.getDefault().getBaseBundleName()); 143 | assertEquals(Locale.ITALIAN, I18NFacade.getDefault().getDefaultLocale()); 144 | assertEquals(Locale.JAPANESE, I18NFacade.getDefault().getActualLocale()); 145 | assertEquals(2, I18NFacade.getDefault().getSupportedLocales().size()); 146 | } 147 | 148 | @Test 149 | public void lastStepWithSupportedLocalesAsObservableList() { 150 | String resourcbundle = "com.github.naoghuman.lib.i18n.internal.resourcebundle"; 151 | final ObservableList locales = FXCollections.observableArrayList(); 152 | locales.addAll(Locale.ITALIAN, Locale.JAPANESE, Locale.FRENCH); 153 | I18NResourceBundleBuilder.configure() 154 | .baseBundleName(resourcbundle) 155 | .supportedLocales(locales) 156 | .defaultLocale(Locale.ITALIAN) 157 | .actualLocale(Locale.JAPANESE) 158 | .build(); 159 | 160 | assertEquals(resourcbundle, I18NFacade.getDefault().getBaseBundleName()); 161 | assertEquals(Locale.ITALIAN, I18NFacade.getDefault().getDefaultLocale()); 162 | assertEquals(Locale.JAPANESE,I18NFacade.getDefault().getActualLocale()); 163 | assertEquals(3, I18NFacade.getDefault().getSupportedLocales().size()); 164 | } 165 | 166 | } 167 | -------------------------------------------------------------------------------- /src/main/java/com/github/naoghuman/lib/i18n/internal/DefaultI18NResourceBundle.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2018 Naoghuman's dream 3 | * 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | package com.github.naoghuman.lib.i18n.internal; 18 | 19 | import com.github.naoghuman.lib.i18n.core.I18NResourceBundle; 20 | import com.github.naoghuman.lib.logger.core.LoggerFacade; 21 | import java.text.MessageFormat; 22 | import java.util.Arrays; 23 | import java.util.List; 24 | import java.util.Locale; 25 | import java.util.MissingResourceException; 26 | import java.util.ResourceBundle; 27 | import javafx.beans.property.ObjectProperty; 28 | import javafx.beans.property.SimpleObjectProperty; 29 | import javafx.collections.FXCollections; 30 | import javafx.collections.ObservableList; 31 | 32 | /** 33 | * The {@code default} implementation from the interface 34 | * {@link com.github.naoghuman.lib.i18n.core.I18NResourceBundle}. 35 | *

36 | * Given {@code attributes} in the methods will be checked by 37 | * {@link com.github.naoghuman.lib.i18n.internal.DefaultI18NValidator}. 38 | * 39 | * @since 0.1.0-PRERELEASE 40 | * @version 0.6.1 41 | * @author Naoghuman 42 | * @see com.github.naoghuman.lib.i18n.core.I18NResourceBundle 43 | * @see com.github.naoghuman.lib.i18n.internal.DefaultI18NValidator 44 | */ 45 | public final class DefaultI18NResourceBundle implements I18NResourceBundle { 46 | 47 | private static final String PATTERN_KEY_NAME = "<{0}>"; // NO18N 48 | 49 | private ObjectProperty actualLocaleProperty; 50 | private ObservableList supportedLocales; 51 | 52 | private Locale defaultLocale; 53 | private String baseBundleName; 54 | 55 | /** 56 | * Default constructor from the is class {@code DefaultI18NResourceBundle}. 57 | * 58 | * @since 0.1.0-PRERELEASE 59 | * @version 0.6.1 60 | * @author Naoghuman 61 | */ 62 | public DefaultI18NResourceBundle() { 63 | this.init(); 64 | } 65 | 66 | private void init() { 67 | defaultLocale = Locale.ENGLISH; 68 | actualLocaleProperty = new SimpleObjectProperty<>(defaultLocale); 69 | supportedLocales = FXCollections.observableArrayList(); 70 | } 71 | 72 | @Override 73 | public String getBaseBundleName() { 74 | DefaultI18NValidator.requireNonNullAndNotEmpty(baseBundleName); 75 | 76 | return baseBundleName; 77 | } 78 | 79 | @Override 80 | public void setBaseBundleName(final String baseBundleName) { 81 | DefaultI18NValidator.requireNonNullAndNotEmpty(baseBundleName); 82 | 83 | this.baseBundleName = baseBundleName; 84 | } 85 | 86 | @Override 87 | public String getMessage(final String key) { 88 | DefaultI18NValidator.requireNonNullAndNotEmpty(key); 89 | DefaultI18NValidator.requireResourceBundleExist(this.getBaseBundleName(), this.getActualLocale()); 90 | 91 | final ResourceBundle bundle = getResourceBundle(); 92 | String value = MessageFormat.format(PATTERN_KEY_NAME, key); 93 | 94 | if (bundle != null) { 95 | try { 96 | value = bundle.getString(key); 97 | } catch (MissingResourceException mre) { 98 | LoggerFacade.getDefault().warn(this.getClass(), 99 | String.format("Can't find key(%s) in resourcebundle. Return: %s", key, value), 100 | mre); 101 | } 102 | } 103 | 104 | return value; 105 | } 106 | 107 | @Override 108 | public String getMessage(final String key, final Object... arguments) { 109 | DefaultI18NValidator.requireNonNullAndNotEmpty(key); 110 | DefaultI18NValidator.requireNonNullAndNotEmpty(arguments); 111 | DefaultI18NValidator.requireResourceBundleExist(this.getBaseBundleName(), this.getActualLocale()); 112 | 113 | final ResourceBundle bundle = getResourceBundle(); 114 | String value = MessageFormat.format(PATTERN_KEY_NAME, key); 115 | 116 | if (bundle != null) { 117 | try { 118 | value = MessageFormat.format(bundle.getString(key), arguments); 119 | } catch (MissingResourceException mre) { 120 | LoggerFacade.getDefault().warn(this.getClass(), 121 | String.format("Can't find key(%s) in resourcebundle. Return: %s", key, value), 122 | mre); 123 | } 124 | } 125 | 126 | return value; 127 | } 128 | 129 | private ResourceBundle getResourceBundle() { 130 | ResourceBundle bundle = null; 131 | try { 132 | bundle = ResourceBundle.getBundle(this.getBaseBundleName(), this.getActualLocale()); 133 | } catch (MissingResourceException mre) { 134 | LoggerFacade.getDefault().error(this.getClass(), 135 | String.format("Can't access the ResourceBundle[path=%s, actual-locale=%s]", 136 | this.getBaseBundleName(), this.getActualLocale().getDisplayLanguage()), 137 | mre); 138 | } 139 | 140 | return bundle; 141 | } 142 | 143 | @Override 144 | public ObservableList getSupportedLocales() { 145 | DefaultI18NValidator.requireNonNull(supportedLocales); 146 | 147 | return supportedLocales; 148 | } 149 | 150 | @Override 151 | public void setSupportedLocales(final ObservableList locales) { 152 | DefaultI18NValidator.requireNonNullAndNotEmpty(locales); 153 | 154 | supportedLocales.clear(); 155 | supportedLocales.addAll(locales); 156 | } 157 | 158 | @Override 159 | public void setSupportedLocales(final Locale... locales) { 160 | final List list = Arrays.asList(locales); 161 | DefaultI18NValidator.requireNonNullAndNotEmpty(list); 162 | 163 | supportedLocales.clear(); 164 | supportedLocales.addAll(list); 165 | } 166 | 167 | @Override 168 | public Locale getDefaultLocale() { 169 | DefaultI18NValidator.requireNonNull(defaultLocale); 170 | 171 | return defaultLocale; 172 | } 173 | 174 | @Override 175 | public void setDefaultLocale(final Locale locale) { 176 | DefaultI18NValidator.requireNonNull(locale); 177 | 178 | defaultLocale = this.getSupportedLocales().contains(locale) ? locale : Locale.ENGLISH; 179 | } 180 | 181 | @Override 182 | public Locale getActualLocale() { 183 | DefaultI18NValidator.requireNonNull(actualLocaleProperty.get()); 184 | 185 | return actualLocaleProperty.get(); 186 | } 187 | 188 | @Override 189 | public void setActualLocale(final Locale locale) { 190 | DefaultI18NValidator.requireNonNull(locale); 191 | 192 | actualLocaleProperty.set(this.getSupportedLocales().contains(locale) ? locale : defaultLocale); 193 | } 194 | 195 | @Override 196 | public ObjectProperty actualLocaleProperty() { 197 | DefaultI18NValidator.requireNonNull(actualLocaleProperty); 198 | 199 | return actualLocaleProperty; 200 | } 201 | 202 | } 203 | -------------------------------------------------------------------------------- /pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 4.0.0 5 | com.github.naoghuman 6 | lib-i18n 7 | 0.8.0 8 | jar 9 | Lib-I18N 10 | 2018 11 | https://github.com/Naoghuman/lib-i18n.git 12 | 13 | The library `Lib-I18N` allows a developer to bind a key-value pair of a `.properties` file to a [StringBinding]. This makes it very easy to change the language during runtime in a [JavaFX] application. 14 | Lib-I18N is written in JavaFX, [Maven] and [NetBeans]. 15 | 16 | 17 | 18 | peter.rogge@yahoo.de 19 | Naoghuman 20 | Peter Rogge 21 | +1 22 | https://github.com/Naoghuman/lib-i18n.git 23 | 24 | 25 | 26 | 27 | 28 | The GNU General Public License, Version 3.0 29 | http://www.gnu.org/licenses/gpl-3.0.en.html 30 | repo 31 | The GNU General Public License is a free, copyleft license for software and other kinds of works. 32 | 33 | 34 | 35 | 36 | Naoghuman's dream 37 | 38 | 39 | 40 | scm:git:ssh://github.com:Naoghuman/lib-i18n.git 41 | scm:git:ssh://git@github.com:Naoghuman/lib-i18n.git 42 | https://github.com/Naoghuman/lib-i18n.git 43 | 44 | 45 | 46 | Travis 47 | https://travis-ci.org/Naoghuman/lib-i18n 48 | 49 | 50 | 51 | UTF-8 52 | 1.8 53 | 1.8 54 | 55 | 56 | 57 | 58 | 59 | org.apache.maven.plugins 60 | maven-jar-plugin 61 | 3.1.1 62 | 63 | 64 | **/log4j2.xml 65 | **/com/github/naoghuman/lib/i18n/*.java 66 | **/com/github/naoghuman/lib/i18n/*.fxml 67 | **/com/github/naoghuman/lib/i18n/*.css 68 | **/com/github/naoghuman/lib/i18n/*.properties 69 | **/com/github/naoghuman/lib/i18n/*.png 70 | **/com/github/naoghuman/lib/i18n/*.txt 71 | **/com/github/naoghuman/lib/i18n/internal/*.properties 72 | 73 | 74 | 75 | 76 | org.apache.maven.plugins 77 | maven-compiler-plugin 78 | 3.8.0 79 | 80 | 1.8 81 | 1.8 82 | 83 | 84 | 85 | 86 | org.apache.maven.plugins 87 | maven-source-plugin 88 | 3.0.1 89 | 90 | 91 | attach-sources 92 | 93 | jar 94 | 95 | 96 | 97 | 98 | 99 | org.apache.maven.plugins 100 | maven-javadoc-plugin 101 | 3.0.1 102 | 103 | -Xdoclint:none 104 | docs/apidocs 105 | 106 | 107 | 108 | 109 | attach-javadocs 110 | 111 | jar 112 | 113 | 114 | 115 | 116 | 117 | 118 | org.apache.maven.plugins 119 | maven-gpg-plugin 120 | 1.6 121 | 122 | 123 | sign-artifacts 124 | verify 125 | 126 | sign 127 | 128 | 129 | 130 | 131 | 132 | 133 | 138 | 139 | src/test/resources 140 | 141 | **/*.fxml 142 | **/*.css 143 | **/*.png 144 | **/*.properties 145 | **/*.txt 146 | **/*.xml 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | com.github.naoghuman 155 | lib-logger 156 | 0.6.0 157 | jar 158 | 159 | 160 | 161 | com.github.naoghuman 162 | lib-fxml 163 | 0.3.0-PRERELEASE 164 | test 165 | jar 166 | 167 | 168 | junit 169 | junit 170 | 4.12 171 | test 172 | jar 173 | 174 | 175 | org.hamcrest 176 | hamcrest-core 177 | 1.3 178 | test 179 | 180 | 181 | org.mockito 182 | mockito-all 183 | 1.10.19 184 | test 185 | 186 | 187 | 188 | 189 | -------------------------------------------------------------------------------- /src/main/java/com/github/naoghuman/lib/i18n/internal/DefaultI18NValidator.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2018 Naoghuman's dream 3 | * 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | package com.github.naoghuman.lib.i18n.internal; 18 | 19 | import java.util.Arrays; 20 | import java.util.Locale; 21 | import java.util.Objects; 22 | import java.util.ResourceBundle; 23 | import javafx.collections.FXCollections; 24 | import javafx.collections.ObservableList; 25 | 26 | 27 | /** 28 | * An implementation from different {@code validation} methods to check preconditions 29 | * in the topic from this library {@code Lib-I18N}. 30 | * 31 | * @since 0.1.0-PRERELEASE 32 | * @version 0.6.1 33 | * @author Naoghuman 34 | */ 35 | public final class DefaultI18NValidator { 36 | 37 | /** 38 | * Delegates to {@link java.util.Objects#isNull(java.lang.Object)}. 39 | *

40 | * This method exists to be used as a {@link java.util.function.Predicate}, 41 | * {@code filter(Objects::isNull)}. 42 | * 43 | * @param obj a reference which will be checked against {@code NULL}. 44 | * @return {@code TRUE} if the provided reference is {@code NULL} otherwise {@code FALSE}. 45 | * @since 0.1.0-PRERELEASE 46 | * @version 0.6.1 47 | * @author Naoghuman 48 | * @see java.util.function.Predicate 49 | */ 50 | public static boolean isNull(final Object obj) { 51 | return Objects.isNull(obj); 52 | } 53 | 54 | /** 55 | * Delegates to {@link java.util.Objects#nonNull(java.lang.Object)}. 56 | *

57 | * This method exists to be used as a {@link java.util.function.Predicate}, 58 | * {@code filter(Objects::nonNull)}. 59 | * 60 | * @param obj a reference which will be checked against {@code NULL}. 61 | * @return {@code TRUE} if the provided reference is {@code NON-NULL} otherwise {@code FALSE}. 62 | * @since 0.1.0-PRERELEASE 63 | * @version 0.6.1 64 | * @author Naoghuman 65 | * @see java.util.function.Predicate 66 | */ 67 | public static boolean nonNull(final Object obj) { 68 | return Objects.nonNull(obj); 69 | } 70 | 71 | /** 72 | * Validates if the attribute {@code value} isn't {@code NULL}. 73 | *

74 | * An additional error message will be added to the error stack: 75 | *

    76 | *
  • The attribute [value] can't be NULL.
  • 77 | *
78 | * 79 | * @param the type of the reference. 80 | * @param value the attribute which should be validated. 81 | * @throws NullPointerException if {@code (value == NULL)}. 82 | * @since 0.1.0-PRERELEASE 83 | * @version 0.6.1 84 | * @author Naoghuman 85 | */ 86 | public static void requireNonNull(final T value) throws NullPointerException { 87 | Objects.requireNonNull(value, "The attribute [value] can't be NULL."); // NOI18N 88 | } 89 | 90 | /** 91 | * Validates if the attribute {@code value} isn't {@code NULL} and not {@code EMPTY}. 92 | *

93 | * Adds following additional error messages depending from the error to the error stack: 94 | *

    95 | *
  • The attribute [value] can't be NULL.
  • 96 | *
  • The attribute [value] can't be EMPTY.
  • 97 | *
98 | * 99 | * @param value the attribute which should be validated. 100 | * @throws NullPointerException if {@code (value == NULL)}. 101 | * @throws IllegalArgumentException if {@code (value.trim() == EMPTY)}. 102 | * @since 0.1.0-PRERELEASE 103 | * @version 0.6.1 104 | * @author Naoghuman 105 | */ 106 | public static void requireNonNullAndNotEmpty(final String value) throws NullPointerException, IllegalArgumentException { 107 | Objects.requireNonNull(value, "The attribute [value] can't be NULL."); // NOI18N 108 | 109 | if (value.trim().isEmpty()) { 110 | throw new IllegalArgumentException("The attribute [value] can't be EMPTY."); // NOI18N 111 | } 112 | } 113 | 114 | /** 115 | * Validates if the attribute {@code elements} isn't {@code NULL} and not {@code EMPTY}. 116 | *

117 | * Adds following additional error messages depending from the error to the error stack: 118 | *

    119 | *
  • The attribute [elements] can't be NULL.
  • 120 | *
  • The attribute [elements] can't be EMPTY.
  • 121 | *
122 | * 123 | * @param elements the attribute which should be validated. 124 | * @throws NullPointerException if {@code (elements == NULL)}. 125 | * @throws IllegalArgumentException if {@code (elements == EMPTY)}. 126 | * @since 0.1.0-PRERELEASE 127 | * @version 0.6.1 128 | * @author Naoghuman 129 | */ 130 | public static void requireNonNullAndNotEmpty(final Object... elements) throws NullPointerException, IllegalArgumentException { 131 | Objects.requireNonNull(elements, "The attribute [elements] can't be NULL."); // NOI18N 132 | 133 | final ObservableList elements2 = FXCollections.observableArrayList(); 134 | elements2.addAll(Arrays.asList(elements)); 135 | 136 | if (elements2.isEmpty()) { 137 | throw new IllegalArgumentException("The attribute [elements] can't be EMPTY."); // NOI18N 138 | } 139 | } 140 | 141 | /** 142 | * Validates if the attribute {@code elements} isn't {@code NULL} and not {@code EMPTY}. 143 | *

144 | * Adds following additional error messages depending from the error to the error stack: 145 | *

    146 | *
  • The attribute [elements] can't be NULL.
  • 147 | *
  • The attribute [elements] can't be EMPTY.
  • 148 | *
149 | * 150 | * @param the type of the reference. 151 | * @param elements the attribute which should be validated. 152 | * @throws NullPointerException if {@code (elements == NULL)}. 153 | * @throws IllegalArgumentException if {@code (elements == EMPTY)}. 154 | * @since 0.1.0-PRERELEASE 155 | * @version 0.6.1 156 | * @author Naoghuman 157 | */ 158 | public static void requireNonNullAndNotEmpty(final ObservableList elements) throws NullPointerException, IllegalArgumentException { 159 | Objects.requireNonNull(elements, "The attribute [elements] can't be NULL"); // NOI18N 160 | 161 | if (elements.isEmpty()) { 162 | throw new IllegalArgumentException("The attribute [elements] can't be EMPTY"); // NOI18N 163 | } 164 | } 165 | 166 | /** 167 | * Checks if a {@link java.util.ResourceBundle} with the given parameters can be loaded. 168 | *

169 | * If the {@code ResourceBundle} can't be found a {@link java.util.MissingResourceException} 170 | * will be thrown. 171 | * 172 | * @param baseBundleName which should be used to load the {@code ResourceBundle}. 173 | * @param actualLocale which should be used to load the {@code ResourceBundle}. 174 | * @since 0.7.0 175 | * @version 0.7.0 176 | * @author Naoghuman 177 | * @see java.util.MissingResourceException 178 | * @see java.util.ResourceBundle 179 | */ 180 | public static void requireResourceBundleExist(final String baseBundleName, final Locale actualLocale) { 181 | DefaultI18NValidator.requireNonNullAndNotEmpty(baseBundleName); 182 | DefaultI18NValidator.requireNonNull(actualLocale); 183 | 184 | ResourceBundle.getBundle(baseBundleName, actualLocale); 185 | } 186 | 187 | } 188 | -------------------------------------------------------------------------------- /docs/apidocs/com/github/naoghuman/lib/i18n/core/class-use/I18NFacade.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Uses of Class com.github.naoghuman.lib.i18n.core.I18NFacade (Lib-I18N 0.8.0 API) 8 | 9 | 10 | 11 | 12 | 13 | 23 |

JavaScript is disabled on your browser.
25 | 26 | 27 |
28 | 29 | 30 | 31 | 32 | 33 | 34 | 44 |
45 | 72 | 73 |
74 |

Uses of Class
com.github.naoghuman.lib.i18n.core.I18NFacade

75 |
76 |
77 | 123 |
124 | 125 |
126 | 127 | 128 | 129 | 130 | 131 | 132 | 142 |
143 | 170 | 171 |

Copyright © 2018–2019 Naoghuman's dream. All rights reserved.

172 | 173 | 174 | --------------------------------------------------------------------------------