-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Replacing locale at runtime #4
Comments
@TheLeonsver1 Thanks for feedback I am still undecided on the architecture of the plugin. Snapshot from the You can take a look at |
Great :D would you be fine with adding this crate to 'awesome_bevy`? |
Thank you for your help. I was planning to announce this plugin (including adding it to awesome-bevy) as soon as I have precisely defined its internal architecture. |
Cool! glad to hear :D |
Hi, i'm trying to use the
with help from the bevy discord, I've been told that |
I think there might be another issue, the assets loaded by |
right Be careful, the I am waiting bevyengine/bevy#2224 for merge
The resulting asset ( pub fn get_load_state<H: Into<HandleId>>(&self, handle: H) -> LoadState {
match handle.into() {
HandleId::AssetPathId(id) => { ... }
HandleId::Id(_, _) => LoadState::NotLoaded,
}
} In the example, I solved this problem like this. |
oh, got it, thank you very much for the help! :) |
Fixed: #5 |
I've tried to look at the code for ways to replace the chosen
locale
at runtime and I've noticedthat
Snapshot
has anIndexMap
for the locales and their bundles.But
Snapshot
's only being loaded with one locale(and I've discussed this with the community and they agree that it's better to hold in memory only the bundle for the locale used), thedefault
locale that's set insideFluentSettings
.(It should be mentioned that I haven't checked if you load all the locale assets and keep them in memory even though they are not loaded into
Snapshot
)I think that in this case, the
IndexMap
can be replaced with just a struct that holds abundle
and thelocale
used.I've also seen that you cannot replace the locale used in-game unless you
init_resource
for theSnapshot
again(after replacing the locale inFluentSettings
), but that is not possible at the current version because you check that the resource wasn't already initiated in the world.So it's currently impossible to replace the locale at runtime which I think would be really useful for your users.
would love to hear your input about these issues, thanks for the crate!
The text was updated successfully, but these errors were encountered: