Skip to content

Commit 501ad02

Browse files
committed
Auto merge of #108682 - est31:simplify_dirs, r=davidtwco
Simplify message paths This makes it easier to open the messages file. Right now I have to first click on the `locales` dir to open it, and then on the `en-US.ftl` file. `Cargo.toml` and `build.rs` files are also in the top level, and I think there should not be more than one file, so a directory isn't really needed. The [chosen strategy for pontoon adoption](https://rust-lang.zulipchat.com/#narrow/stream/336883-i18n/topic/pontoon.20and.20next.20steps) is out of tree. Even if this descision is changed in the future, the `messages.ftl` approach is also compatible with non-english translations living in-tree, as long as the non-english translations don't live in the `compiler/rustc_foo/` directories but in different ones. That would also be helpful for grepability purposes. The commit was the result of automated changes: ``` for p in compiler/rustc_*; do mv $p/locales/en-US.ftl $p/messages.ftl; rmdir $p/locales; done for p in compiler/rustc_*; do sed -i "s#\.\./locales/en-US.ftl#../messages.ftl#" $p/src/lib.rs; done ``` r? `@davidtwco`
2 parents 9455a55 + 7e2ecb3 commit 501ad02

File tree

68 files changed

+34
-34
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

68 files changed

+34
-34
lines changed

compiler/rustc_ast_lowering/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ mod lifetime_collector;
9292
mod pat;
9393
mod path;
9494

95-
fluent_messages! { "../locales/en-US.ftl" }
95+
fluent_messages! { "../messages.ftl" }
9696

9797
struct LoweringContext<'a, 'hir> {
9898
tcx: TyCtxt<'hir>,

compiler/rustc_ast_passes/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,4 @@ pub mod feature_gate;
2121
pub mod node_count;
2222
pub mod show_span;
2323

24-
fluent_messages! { "../locales/en-US.ftl" }
24+
fluent_messages! { "../messages.ftl" }

compiler/rustc_attr/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,4 @@ pub use rustc_ast::attr::*;
2626

2727
pub(crate) use rustc_ast::HashStableContext;
2828

29-
fluent_messages! { "../locales/en-US.ftl" }
29+
fluent_messages! { "../messages.ftl" }

compiler/rustc_borrowck/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ use places_conflict::{places_conflict, PlaceConflictBias};
100100
use region_infer::RegionInferenceContext;
101101
use renumber::RegionCtxt;
102102

103-
fluent_messages! { "../locales/en-US.ftl" }
103+
fluent_messages! { "../messages.ftl" }
104104

105105
// FIXME(eddyb) perhaps move this somewhere more centrally.
106106
#[derive(Debug)]

compiler/rustc_builtin_macros/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ pub mod proc_macro_harness;
5656
pub mod standard_library_imports;
5757
pub mod test_harness;
5858

59-
fluent_messages! { "../locales/en-US.ftl" }
59+
fluent_messages! { "../messages.ftl" }
6060

6161
pub fn register_builtin_macros(resolver: &mut dyn ResolverExpand) {
6262
let mut register = |name, kind| resolver.register_builtin_macro(name, kind);

0 commit comments

Comments
 (0)