Skip to content

Commit

Permalink
Bug 1626969: Expose locale through the RLB so that it can be set by…
Browse files Browse the repository at this point in the history
… consumers
  • Loading branch information
travis79 committed Jul 12, 2023
1 parent 46017fb commit 4198786
Show file tree
Hide file tree
Showing 8 changed files with 12 additions and 1 deletion.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@

* Rust
* The Ping Rate Limit type is now accessible in the Rust Language Binding ([#2528](https://github.com/mozilla/glean/pull/2528))

* `locale` now exposed through the RLB so it can be set by consumers ([2527](https://github.com/mozilla/glean/pull/2527))

# v53.1.0 (2023-06-28)

[Full changelog](https://github.com/mozilla/glean/compare/v53.0.0...v53.1.0)
Expand Down
1 change: 1 addition & 0 deletions docs/user/reference/general/initializing.md
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,7 @@ let client_info = ClientInfoMetrics {
app_build: env!("CARGO_PKG_VERSION").to_string(),
app_display_version: env!("CARGO_PKG_VERSION").to_string(),
channel: None,
locale: None,
};

glean::initialize(cfg, client_info);
Expand Down
1 change: 1 addition & 0 deletions glean-core/rlb/examples/long-running.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ fn main() {
app_build: env!("CARGO_PKG_VERSION").to_string(),
app_display_version: env!("CARGO_PKG_VERSION").to_string(),
channel: None,
locale: None,
};

glean::initialize(cfg, client_info);
Expand Down
1 change: 1 addition & 0 deletions glean-core/rlb/examples/prototype.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ fn main() {
app_build: env!("CARGO_PKG_VERSION").to_string(),
app_display_version: env!("CARGO_PKG_VERSION").to_string(),
channel: None,
locale: None,
};

glean::initialize(cfg, client_info);
Expand Down
4 changes: 4 additions & 0 deletions glean-core/rlb/src/core_metrics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ pub struct ClientInfoMetrics {
pub app_display_version: String,
/// The product-provided release channel (e.g. "beta").
pub channel: Option<String>,
/// The locale of the application during initialization (e.g. "es-ES").
pub locale: Option<String>,
}

impl ClientInfoMetrics {
Expand All @@ -22,6 +24,7 @@ impl ClientInfoMetrics {
app_build: "Unknown".to_string(),
app_display_version: "Unknown".to_string(),
channel: None,
locale: None,
}
}
}
Expand All @@ -32,6 +35,7 @@ impl From<ClientInfoMetrics> for glean_core::ClientInfoMetrics {
app_build: metrics.app_build,
app_display_version: metrics.app_display_version,
channel: metrics.channel,
locale: metrics.locale,
os_version: system::get_os_version(),
windows_build_number: system::get_windows_build_number(),
architecture: system::ARCH.to_string(),
Expand Down
1 change: 1 addition & 0 deletions glean-core/rlb/tests/common/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ pub fn initialize(cfg: Configuration) {
app_build: "1.0.0".to_string(),
app_display_version: "1.0.0".to_string(),
channel: Some("testing".to_string()),
locale: Some("xx-XX".to_string()),
};

glean::initialize(cfg, client_info);
Expand Down
1 change: 1 addition & 0 deletions glean-core/rlb/tests/schema.rs
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ fn validate_against_schema() {
app_build: env!("CARGO_PKG_VERSION").to_string(),
app_display_version: env!("CARGO_PKG_VERSION").to_string(),
channel: Some("testing".to_string()),
locale: Some("xx-XX".to_string()),
};

glean::initialize(cfg, client_info);
Expand Down
1 change: 1 addition & 0 deletions samples/rust/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ fn main() {
app_build: env!("CARGO_PKG_VERSION").to_string(),
app_display_version: env!("CARGO_PKG_VERSION").to_string(),
channel: None,
locale: None,
};

glean::initialize(cfg, client_info);
Expand Down

0 comments on commit 4198786

Please sign in to comment.