-
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.
Merge pull request #181 from kellpossible/fix-macos-ci-gettext
Create a mock for gettext-rs in order to fix the failing build on macos
- Loading branch information
Showing
5 changed files
with
61 additions
and
81 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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,7 @@ | ||
[package] | ||
name = "gettext-rs" | ||
version = "0.1.0" | ||
edition = "2021" | ||
|
||
[lib] | ||
name = "gettextrs" |
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,3 @@ | ||
# gettext-rs (mock) | ||
|
||
This is a mock for `gettext-rs` crate that is being used temporarily to fix the build on macos while we figure out a resolution to https://github.com/gettext-rs/gettext-rs/issues/121 |
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 @@ | ||
pub fn setlocale<T: Into<Vec<u8>>>(_category: LocaleCategory, locale: T) -> Option<Vec<u8>> { | ||
Some(locale.into()) | ||
} | ||
|
||
pub fn bind_textdomain_codeset<T, U>( | ||
_domainname: T, | ||
_codeset: U, | ||
) -> Result<Option<String>, std::io::Error> | ||
where | ||
T: Into<Vec<u8>>, | ||
U: Into<String>, | ||
{ | ||
Ok(None) | ||
} | ||
|
||
pub fn textdomain<T: Into<Vec<u8>>>(domainname: T) -> Result<Vec<u8>, std::io::Error> { | ||
Ok(domainname.into()) | ||
} | ||
|
||
pub fn gettext<T: Into<String>>(msgid: T) -> String { | ||
return msgid.into(); | ||
} | ||
|
||
#[macro_export] | ||
macro_rules! gettext { | ||
($fmt:expr) => { | ||
format!($fmt) | ||
}; | ||
($fmt:expr, $($arg:tt)*) => { | ||
format!($fmt, $($arg)*) | ||
}; | ||
} | ||
|
||
pub enum LocaleCategory { | ||
LcCType, | ||
LcNumeric, | ||
LcTime, | ||
LcCollate, | ||
LcMonetary, | ||
LcMessages, | ||
LcAll, | ||
LcPaper, | ||
LcName, | ||
LcAddress, | ||
LcTelephone, | ||
LcMeasurement, | ||
LcIdentification, | ||
} |