-
Notifications
You must be signed in to change notification settings - Fork 104
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #245 from sialcasa/235_included_resource_bundle
#235 included resource bundle
- Loading branch information
Showing
17 changed files
with
204 additions
and
75 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 7 additions & 0 deletions
7
examples/mvvmfx-contacts/src/main/resources/menu_de.properties
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
menu.file=Datei | ||
menu.file.close=Schließen | ||
menu.edit=Bearbeiten | ||
menu.edit.removecontact=Kontakt entfernen | ||
|
||
menu.help=Hilfe | ||
menu.help.about=Über |
7 changes: 7 additions & 0 deletions
7
examples/mvvmfx-contacts/src/main/resources/menu_en.properties
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
|
||
menu.file=File | ||
menu.file.close=Close | ||
menu.edit=Edit | ||
menu.edit.removecontact=Remove contact | ||
menu.help=Help | ||
menu.help.about=About |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
48 changes: 48 additions & 0 deletions
48
mvvmfx/src/test/java/de/saxsys/mvvmfx/internal/viewloader/ResourceBundleAssert.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
package de.saxsys.mvvmfx.internal.viewloader; | ||
|
||
import org.assertj.core.api.AbstractAssert; | ||
|
||
import java.util.ResourceBundle; | ||
|
||
/** | ||
* @author manuel.mauky | ||
*/ | ||
public class ResourceBundleAssert extends AbstractAssert<ResourceBundleAssert, ResourceBundle> { | ||
|
||
private ResourceBundleAssert(ResourceBundle actual) { | ||
super(actual, ResourceBundleAssert.class); | ||
} | ||
|
||
public static ResourceBundleAssert assertThat(ResourceBundle resourceBundle){ | ||
return new ResourceBundleAssert(resourceBundle); | ||
} | ||
|
||
public ResourceBundleAssert hasSameContent(ResourceBundle other){ | ||
isNotNull(); | ||
|
||
if(other == null) { | ||
failWithMessage("The given ResourceBundle may not be null"); | ||
return this; | ||
} | ||
|
||
if(actual.equals(other)) { | ||
return this; | ||
} | ||
|
||
for (String key : actual.keySet()) { | ||
final Object actualValue = actual.getObject(key); | ||
if(!other.containsKey(key)){ | ||
failWithMessage("Expected given ResourceBundle to contain the key <%s>", key); | ||
} | ||
|
||
final Object otherValue = other.getObject(key); | ||
|
||
if(!actualValue.equals(otherValue)){ | ||
failWithMessage("For the key <%s> the given ResourceBundle has a value of <%s> but a value of <%s> like in the actual ResourceBundle was expected", key, otherValue, actualValue); | ||
} | ||
} | ||
|
||
return this; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.