Skip to content

Commit bd18870

Browse files
authored
Fix some typos using typos-cli (#143)
* Fix some typos using typos-cli
1 parent ceb3da0 commit bd18870

File tree

10 files changed

+47
-35
lines changed

10 files changed

+47
-35
lines changed

.typos.toml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# https://github.com/crate-ci/typos
2+
# install: cargo install typos-cli
3+
# run: typos
4+
5+
# Ignore the contents of localization files (but check their names)
6+
[type.po]
7+
extend-glob = ["*.po"]
8+
check-file = false
9+
10+
[type.ftl]
11+
extend-glob = ["*.ftl"]
12+
check-file = false

i18n-build/src/gettext_impl/mod.rs

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ fn crate_module_pot_file_path<P: AsRef<Path>>(crt: &Crate<'_>, pot_dir: P) -> Pa
154154
.with_extension("pot")
155155
}
156156

157-
/// Run the gettext utils `msgcat` command to concatinate pot files
157+
/// Run the gettext utils `msgcat` command to concatenate pot files
158158
/// into a single pot file.
159159
pub fn run_msgcat<P: AsRef<Path>, I: IntoIterator<Item = P>>(
160160
input_pot_paths: I,
@@ -174,7 +174,7 @@ pub fn run_msgcat<P: AsRef<Path>, I: IntoIterator<Item = P>>(
174174
}
175175

176176
info!(
177-
"Concatinating pot files {0:?} with `msgcat` into \"{1}\"",
177+
"Concatenating pot files {0:?} with `msgcat` into \"{1}\"",
178178
input_pot_paths_strings,
179179
output_pot_path.as_ref().to_string_lossy()
180180
);
@@ -456,32 +456,32 @@ pub fn run(crt: &Crate) -> Result<()> {
456456
}
457457

458458
// figure out where there are any subcrates which need their output
459-
// pot files concatinated with this crate's pot file
460-
let mut concatinate_crates = vec![];
459+
// pot files concatenated with this crate's pot file
460+
let mut concatenate_crates = vec![];
461461
for subcrate in &subcrates {
462462
run(subcrate)?;
463463
if subcrate.collated_subcrate() {
464-
concatinate_crates.push(subcrate);
464+
concatenate_crates.push(subcrate);
465465
}
466466
}
467467

468-
// Perform the concatination (if there are any required)
469-
if !concatinate_crates.is_empty() {
468+
// Perform the concatenation (if there are any required)
469+
if !concatenate_crates.is_empty() {
470470
assert!(crt.gettext_config_or_err()?.collate_extracted_subcrates);
471-
concatinate_crates.insert(0, crt);
471+
concatenate_crates.insert(0, crt);
472472

473-
let concatinate_crate_paths: Vec<PathBuf> = concatinate_crates
473+
let concatenate_crate_paths: Vec<PathBuf> = concatenate_crates
474474
.iter()
475475
.map(|concat_crt: &&Crate| crate_module_pot_file_path(concat_crt, &pot_dir))
476476
.collect();
477477

478478
let output_pot_path = crate_module_pot_file_path(crt, &pot_dir);
479-
run_msgcat(concatinate_crate_paths, output_pot_path)?;
479+
run_msgcat(concatenate_crate_paths, output_pot_path)?;
480480

481481
// remove this crate from the list because we don't want to delete it's pot file
482-
concatinate_crates.remove(0);
482+
concatenate_crates.remove(0);
483483

484-
for subcrate in concatinate_crates {
484+
for subcrate in concatenate_crates {
485485
let subcrate_output_pot_path = crate_module_pot_file_path(subcrate, &pot_dir);
486486
util::remove_file_or_error(subcrate_output_pot_path)?;
487487
}

i18n-config/src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//! This library contains the configuration stucts (along with their
1+
//! This library contains the configuration structs (along with their
22
//! parsing functions) for the
33
//! [cargo-i18n](https://crates.io/crates/cargo_i18n) tool/system.
44
@@ -301,7 +301,7 @@ impl<'a> Crate<'a> {
301301
if this_is_subcrate {
302302
Some(crt)
303303
} else {
304-
debug!("Parent {0} does not have {1} correctly listed as one of its subcrates (curently: {2:?}) in its i18n config.", crt, self, config.subcrates);
304+
debug!("Parent {0} does not have {1} correctly listed as one of its subcrates (currently: {2:?}) in its i18n config.", crt, self, config.subcrates);
305305
None
306306
}
307307
}

i18n-embed-fl/examples/web-server/src/main.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,30 +20,30 @@ fn main() {
2020

2121
println!(
2222
"requested [en-US], response: {}",
23-
hande_request(&loader, &[&"en-US".parse().unwrap()])
23+
handle_request(&loader, &[&"en-US".parse().unwrap()])
2424
);
2525
println!(
2626
"requested [ka-GE], response: {}",
27-
hande_request(&loader, &[&"ka-GE".parse().unwrap()])
27+
handle_request(&loader, &[&"ka-GE".parse().unwrap()])
2828
);
2929
println!(
3030
"requested [en-UK], response: {}",
31-
hande_request(&loader, &[&"en-UK".parse().unwrap()])
31+
handle_request(&loader, &[&"en-UK".parse().unwrap()])
3232
);
3333
println!(
3434
"requested [de-AT], response: {}",
35-
hande_request(&loader, &[&"de-AT".parse().unwrap()])
35+
handle_request(&loader, &[&"de-AT".parse().unwrap()])
3636
);
3737
println!(
3838
"requested [ru-RU], response: {}",
39-
hande_request(
39+
handle_request(
4040
&loader,
4141
&[&"ru-RU".parse().unwrap(), &"de-DE".parse().unwrap()]
4242
)
4343
);
4444
}
4545

46-
fn hande_request(
46+
fn handle_request(
4747
loader: &FluentLanguageLoader,
4848
requested_languages: &[&unic_langid::LanguageIdentifier],
4949
) -> String {

i18n-embed-fl/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -330,7 +330,7 @@ fn domains() -> &'static DomainsMap {
330330
/// runtime using a [HashMap](std::collections::HashMap), using the
331331
/// same signature as in
332332
/// [FluentLanguageLoader::get_args()](i18n_embed::fluent::FluentLanguageLoader::get_args()).
333-
/// When using this method of specifying argments, they are not
333+
/// When using this method of specifying arguments, they are not
334334
/// checked at compile time.
335335
///
336336
/// ### Example

i18n-embed/CHANGELOG.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -37,12 +37,12 @@
3737
+ New `autoreload` crate feature.
3838
+ `RustEmbedNotifyAssets` - A wrapper for `rust_embed::RustEmbed` that supports notifications when files have changed on the file system.
3939
+ `FileSystemAssets::notify_changes_enabled()` - A new method to enable watching for changes.
40-
+ `AssetsMultiplexor` - A way to multiplex implmentations of [`I18nAssets`] where assets are multiplexed by a priority.
40+
+ `AssetsMultiplexor` - A way to multiplex implementations of [`I18nAssets`] where assets are multiplexed by a priority.
4141

4242
### Breaking
4343

4444
+ Modified `I18nAssets` trait.
45-
+ Support multiple files referencing the same asset (to allow a heirachy of overrides).
45+
+ Support multiple files referencing the same asset (to allow a hierarchy of overrides).
4646
+ Support for subscribing to updates to assets.
4747
+ Remove deprecated methods for `LanguageConfig`, Please use `lang(...).get_attr_args(...)` etc instead.
4848
+ `LanguageConfig::get_lang()`
@@ -92,7 +92,7 @@
9292

9393
- A new `LanguageLoader::load_available_languages()` method to load all available languages.
9494
- A new `FluentLanguageLoader::select_languages()` method (renamed `FluentLanguageLoader::lang()`).
95-
- A new `FluentLanguageLoader::select_languages_negotiate()` method to select languages based on a negotiation strategy using the available languges.
95+
- A new `FluentLanguageLoader::select_languages_negotiate()` method to select languages based on a negotiation strategy using the available languages.
9696

9797
### Deprecated
9898

@@ -189,7 +189,7 @@ done in #84.
189189

190190
### Internal Changes
191191

192-
- Updated `FluentLanguageLoader` to use a thread safe [IntlLangMemoizer](https://docs.rs/intl-memoizer/0.5.1/intl_memoizer/concurrent/struct.IntlLangMemoizer.html) as per the notes on [FluentBundle's concurrency](https://docs.rs/fluent-bundle/0.15.0/fluent_bundle/bundle/struct.FluentBundle.html#concurrency). This was required to solve a compilation error in `i18n-embed-fl` and may also fix problems for other downstream users who were expecting `FluentLangaugeLoader` to be `Send + Sync`. It might impact performance for those who are not using this in multi-threaded context, please report this, and in which case support for switching the `IntlLangMemoizer` added.
192+
- Updated `FluentLanguageLoader` to use a thread safe [IntlLangMemoizer](https://docs.rs/intl-memoizer/0.5.1/intl_memoizer/concurrent/struct.IntlLangMemoizer.html) as per the notes on [FluentBundle's concurrency](https://docs.rs/fluent-bundle/0.15.0/fluent_bundle/bundle/struct.FluentBundle.html#concurrency). This was required to solve a compilation error in `i18n-embed-fl` and may also fix problems for other downstream users who were expecting `FluentLanguageLoader` to be `Send + Sync`. It might impact performance for those who are not using this in multi-threaded context, please report this, and in which case support for switching the `IntlLangMemoizer` added.
193193

194194
## v0.11.0
195195

@@ -205,7 +205,7 @@ done in #84.
205205

206206
### New Features
207207

208-
- New `LanguageRequester::add_listener_ref()` method to add permenant listeners of type `&dyn Localizer`. This also affects `DesktopLanguageRequester` and `WebLanguageRequester`.
208+
- New `LanguageRequester::add_listener_ref()` method to add permanent listeners of type `&dyn Localizer`. This also affects `DesktopLanguageRequester` and `WebLanguageRequester`.
209209

210210
### Internal Changes
211211

@@ -265,7 +265,7 @@ done in #84.
265265

266266
## v0.8.6
267267

268-
- Update documentation and example to more accurately reflect the current state of `LangaugeRequester::poll()` on various systems.
268+
- Update documentation and example to more accurately reflect the current state of `LanguageRequester::poll()` on various systems.
269269

270270
## v0.8.5
271271

@@ -288,7 +288,7 @@ done in #84.
288288

289289
### New Features
290290

291-
- Added a new `with_mesage_iter()` method to `FluentLanguageLoader`, to allow iterating over the messages available for a particular language.
291+
- Added a new `with_message_iter()` method to `FluentLanguageLoader`, to allow iterating over the messages available for a particular language.
292292
- Added `Default` implementation for `WebLanguageRequester`.
293293

294294
## v0.8.2
@@ -316,7 +316,7 @@ Changes to support the new `i18n-embed-fl` crate's `fl!()` macro, and some major
316316

317317
- Removed `I18nEmbed` trait, and derive macro, it was replaced with the new `I18nAssets` trait.
318318
- Clarified the `domain` and `module` arguments/variable inputs to `FluentLanguageLoader` and `GettextLanguageLoader`, and in the `LanguageLoader` trait with some renaming.
319-
- Removed a bunch of unecessary lifetimes, and `'static` bounds on types, methods and arguments.
319+
- Removed a bunch of unnecessary lifetimes, and `'static` bounds on types, methods and arguments.
320320
- `LanguageRequester::current_languages()`'s return type now uses `String` as the `HashMap` key instead of `&'static str`.
321321
- `available_languages()` implementation moved from `I18nEmbed` to `LanguageLoader`.
322322

i18n-embed/examples/library-fluent/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ pub static LOCALIZATIONS: Lazy<RustEmbedNotifyAssets<LocalizationsEmbed>> = Lazy
1717
static LANGUAGE_LOADER: Lazy<FluentLanguageLoader> = Lazy::new(|| {
1818
let loader: FluentLanguageLoader = fluent_language_loader!();
1919

20-
// Load the fallback langauge by default so that users of the
20+
// Load the fallback language by default so that users of the
2121
// library don't need to if they don't care about localization.
2222
loader
2323
.load_fallback_language(&*LOCALIZATIONS)

i18n-embed/src/assets.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ fn notify_watcher(
209209
/// An entity that watches for changes to localization resources.
210210
///
211211
/// NOTE: Currently we rely in the implicit [`Drop`] implementation to remove file system watches,
212-
/// in the future ther may be new methods added to this trait.
212+
/// in the future there may be new methods added to this trait.
213213
pub trait Watcher {}
214214

215215
#[cfg(feature = "autoreload")]
@@ -283,7 +283,7 @@ impl I18nAssets for FileSystemAssets {
283283
}
284284
}
285285

286-
/// A way to multiplex implmentations of [`I18nAssets`].
286+
/// A way to multiplex implementations of [`I18nAssets`].
287287
pub struct AssetsMultiplexor {
288288
/// Assets that are multiplexed, ordered from most to least priority.
289289
assets: Vec<Box<dyn I18nAssets + Send + Sync + 'static>>,

i18n-embed/src/fluent.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ struct FluentLanguageLoaderInner {
7575
current_languages: CurrentLanguages,
7676
}
7777

78-
/// [LanguageLoader] implemenation for the `fluent` localization
78+
/// [LanguageLoader] implementation for the `fluent` localization
7979
/// system. Also provides methods to access localizations which have
8080
/// been loaded.
8181
///

i18n-embed/src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -329,7 +329,7 @@
329329
//! LANGUAGE_LOADER.get_or_init(|| {
330330
//! let loader = fluent_language_loader!();
331331
//!
332-
//! // Load the fallback langauge by default so that users of the
332+
//! // Load the fallback language by default so that users of the
333333
//! // library don't need to if they don't care about localization.
334334
//! // This isn't required for the `gettext` localization system.
335335
//! loader.load_fallback_language(&Localizations)
@@ -526,7 +526,7 @@ pub trait Localizer {
526526
}
527527
}
528528

529-
/// A simple default implemenation of the [Localizer](Localizer) trait.
529+
/// A simple default implementation of the [Localizer](Localizer) trait.
530530
pub struct DefaultLocalizer<'a> {
531531
/// The source of assets used by this localizer.
532532
pub i18n_assets: &'a (dyn I18nAssets + Send + Sync + 'static),

0 commit comments

Comments
 (0)