-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add translation, locale and resource tests
- Loading branch information
kaitsh
committed
Oct 21, 2019
1 parent
11b1f53
commit 855687b
Showing
10 changed files
with
108 additions
and
19 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
hello = Hello {$world} |
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,22 @@ | ||
defmodule Fluex.ResourcesTest do | ||
use ExUnit.Case | ||
alias FluexTest.TranslatorWithMultipleResources, as: Translator | ||
alias Fluex.Resources | ||
|
||
test "merge_resources/3 merges all resources to build one bundle" do | ||
merged = Resources.merge_resources(Translator, "en", ["test.ftl", "second/second.ftl"]) | ||
assert merged =~ "tabs-close-button" | ||
assert merged =~ "second-level" | ||
end | ||
|
||
test "build_resources/3 loads resource files and returns a list of ftl funtions" do | ||
assert [ | ||
{_, _, [{:ftl, [context: Fluex.Resources], ["en", "test.ftl"]}, [_]]}, | ||
{_, _, [{:ftl, [context: Fluex.Resources], ["en", "second/second.ftl"]}, [_]]} | ||
] = | ||
Resources.build_resources(Translator.__fluex__(:dir), "en", [ | ||
"test.ftl", | ||
"second/second.ftl" | ||
]) | ||
end | ||
end |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
second-level = Second level resource |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
second-level = Risorsa di secondo livello |
File renamed without changes.