Skip to content

Commit

Permalink
Rename API to append_from_text
Browse files Browse the repository at this point in the history
The previous name makes no sense now that we only have one bundle.
  • Loading branch information
RedMser committed Jul 29, 2024
1 parent 145bcd5 commit be8c2b1
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ func _init():
# Godot automatically converts spaces to tabs for multi-line strings, but tabs are invalid in
# FTL syntax. So convert tabs to four spaces. Returns an error that you should handle.
var err_inline = tr_inline.add_bundle_from_text("""
var err_inline = tr_inline.append_from_text("""
-term = email
HELLO =
{ $unreadEmails ->
Expand Down
2 changes: 1 addition & 1 deletion godot/default/localization_test.gd
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ func _init():
var tr_foldername = load("res://de/german-test.ftl")
var tr_inline = TranslationFluent.new()
tr_inline.locale = "pt_PT"
var err_inline = tr_inline.add_bundle_from_text("""
var err_inline = tr_inline.append_from_text("""
-term = email
HELLO =
{ $unreadEmails ->
Expand Down
2 changes: 1 addition & 1 deletion godot/forked/localization_test.gd
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ func _init():
var tr_foldername = load("res://de/german-test.ftl")
var tr_inline = TranslationFluent.new()
tr_inline.locale = "pt_PT"
var err_inline = tr_inline.add_bundle_from_text("""
var err_inline = tr_inline.append_from_text("""
-term = email
HELLO =
{ $unreadEmails ->
Expand Down
2 changes: 1 addition & 1 deletion rust/src/fluent/importer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ impl IResourceFormatLoader for ResourceFormatLoaderFluent {
}
}

let err = translation.bind_mut().add_bundle_from_text(text.to_string());
let err = translation.bind_mut().append_from_text(text.to_string());
if err != GdErr::OK {
return err.ord().to_variant();
}
Expand Down
2 changes: 1 addition & 1 deletion rust/src/fluent/translation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ impl TranslationFluent {
}

#[func]
pub fn add_bundle_from_text(&mut self, text: String) -> GdErr {
pub fn append_from_text(&mut self, text: String) -> GdErr {
let bundle = match &mut self.bundle {
Some(bundle) => bundle,
None => &mut {
Expand Down

0 comments on commit be8c2b1

Please sign in to comment.