-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor repository to use workspaces
- Loading branch information
Showing
13 changed files
with
610 additions
and
24 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,3 @@ | ||
[package] | ||
name = "mdbook-i18n-helpers" | ||
version = "0.2.2" | ||
authors = ["Martin Geisler <mgeisler@google.com>"] | ||
categories = ["command-line-utilities", "localization"] | ||
edition = "2021" | ||
keywords = ["mdbook", "i18n", "translation", "gettext"] | ||
license = "Apache-2.0" | ||
repository = "https://github.com/google/mdbook-i18n-helpers" | ||
description = "Plugins for a mdbook translation workflow based on Gettext." | ||
|
||
[dependencies] | ||
anyhow = "1.0.68" | ||
mdbook = { version = "0.4.25", default-features = false } | ||
polib = "0.2.0" | ||
pulldown-cmark = { version = "0.9.2", default-features = false } | ||
pulldown-cmark-to-cmark = "10.0.4" | ||
regex = "1.9.4" | ||
semver = "1.0.16" | ||
serde_json = "1.0.91" | ||
|
||
[dev-dependencies] | ||
pretty_assertions = "1.3.0" | ||
tempfile = "3.5.0" | ||
[workspace] | ||
members = ["i18n-helpers"] | ||
default-members = ["i18n-helpers"] |
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,24 @@ | ||
[package] | ||
name = "mdbook-i18n-helpers" | ||
version = "0.2.3" | ||
authors = ["Martin Geisler <mgeisler@google.com>"] | ||
categories = ["command-line-utilities", "localization"] | ||
edition = "2021" | ||
keywords = ["mdbook", "i18n", "translation", "gettext"] | ||
license = "Apache-2.0" | ||
repository = "https://github.com/google/mdbook-i18n-helpers" | ||
description = "Plugins for a mdbook translation workflow based on Gettext." | ||
|
||
[dependencies] | ||
anyhow = "1.0.68" | ||
mdbook = { version = "0.4.25", default-features = false } | ||
polib = "0.2.0" | ||
pulldown-cmark = { version = "0.9.2", default-features = false } | ||
pulldown-cmark-to-cmark = "11.0.0" | ||
regex = "1.9.4" | ||
semver = "1.0.16" | ||
serde_json = "1.0.91" | ||
|
||
[dev-dependencies] | ||
pretty_assertions = "1.3.0" | ||
tempfile = "3.5.0" |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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,25 @@ | ||
#![no_main] | ||
|
||
use libfuzzer_sys::fuzz_target; | ||
use mdbook_i18n_helpers::normalize::normalize; | ||
use polib::catalog::Catalog; | ||
use polib::message::Message; | ||
use polib::metadata::CatalogMetadata; | ||
|
||
fuzz_target!(|translations: Vec<(&str, &str)>| { | ||
let catalog = create_catalog(translations); | ||
let _ = normalize(catalog); | ||
}); | ||
|
||
fn create_catalog(translations: Vec<(&str, &str)>) -> Catalog { | ||
let mut catalog = Catalog::new(CatalogMetadata::new()); | ||
for (idx, (msgid, msgstr)) in translations.iter().enumerate() { | ||
let message = Message::build_singular() | ||
.with_source(format!("foo.md:{idx}")) | ||
.with_msgid(String::from(*msgid)) | ||
.with_msgstr(String::from(*msgstr)) | ||
.done(); | ||
catalog.append_or_update(message); | ||
} | ||
catalog | ||
} |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Oops, something went wrong.