-
Notifications
You must be signed in to change notification settings - Fork 13
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 #182 from Baptistemontan/dyn_load_csr
CSR dynamic loading
- Loading branch information
Showing
42 changed files
with
985 additions
and
100 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
Cargo.lock | ||
target | ||
dist | ||
!.vscode | ||
node_modules/ | ||
/test-results/ | ||
/playwright-report/ | ||
/blob-report/ | ||
/playwright/.cache/ |
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,5 @@ | ||
{ | ||
"recommendations": [ | ||
"lokalise.i18n-ally", | ||
] | ||
} |
10 changes: 10 additions & 0 deletions
10
examples/dynamic_load/csr_counter/.vscode/i18n-ally-custom-framework.yml
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,10 @@ | ||
languageIds: | ||
- rust | ||
|
||
usageMatchRegex: | ||
- "[^\\w\\d]t!\\(\\s*[\\w.:]*,\\s*([\\w.]*)" | ||
- "[^\\w\\d]td!\\(\\s*[\\w.:]*,\\s*([\\w.]*)" | ||
- "[^\\w\\d]td_string!\\(\\s*[\\w.:]*,\\s*([\\w.]*)" | ||
- "[^\\w\\d]td_display!\\(\\s*[\\w.:]*,\\s*([\\w.]*)" | ||
|
||
monopoly: true |
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,5 @@ | ||
{ | ||
"i18n-ally.keystyle": "nested", | ||
"i18n-ally.localesPaths": "locales", | ||
"rust-analyzer.cargo.buildScripts.enable": true | ||
} |
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,26 @@ | ||
[package] | ||
name = "csr_counter" | ||
version = "0.1.0" | ||
edition = "2021" | ||
|
||
[dependencies] | ||
leptos = { version = "0.7.0", features = ["csr"] } | ||
leptos_i18n = { path = "../../../leptos_i18n", features = [ | ||
"csr", | ||
"plurals", | ||
"dynamic_load", | ||
"track_locale_files", | ||
] } | ||
console_error_panic_hook = { version = "0.1" } | ||
|
||
[package.metadata.leptos-i18n] | ||
default = "en" | ||
locales = ["en", "fr"] | ||
translations-uri = "i18n/{locale}.json" | ||
|
||
[build-dependencies] | ||
leptos_i18n_build = { path = "../../../leptos_i18n_build" } | ||
|
||
[profile.release] | ||
opt-level = "z" | ||
lto = true |
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,11 @@ | ||
# Dynamic Load CSR Counter Example | ||
|
||
This example showcase how you can use dynamic load with CSR. | ||
|
||
## How to run | ||
|
||
Simply use `trunk` to run it: | ||
|
||
```bash | ||
trunk serve --open | ||
``` |
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,15 @@ | ||
use leptos_i18n_build::TranslationsInfos; | ||
|
||
fn main() { | ||
println!("cargo:rerun-if-changed=build.rs"); | ||
println!("cargo:rerun-if-changed=Cargo.toml"); | ||
|
||
let translations_infos = TranslationsInfos::parse().unwrap(); | ||
|
||
translations_infos.rerun_if_locales_changed(); | ||
|
||
translations_infos | ||
.get_translations() | ||
.write_to_dir("./target/i18n") | ||
.unwrap(); | ||
} |
Oops, something went wrong.