Skip to content
This repository was archived by the owner on Feb 27, 2024. It is now read-only.

Implement support for server-side localized text#234

Closed
zml2008 wants to merge 1 commit intomasterfrom
feature/translations
Closed

Implement support for server-side localized text#234
zml2008 wants to merge 1 commit intomasterfrom
feature/translations

Conversation

@zml2008
Copy link
Member

@zml2008 zml2008 commented Apr 11, 2015

@zml2008 zml2008 force-pushed the feature/translations branch 2 times, most recently from e7f17f1 to 4f27696 Compare April 12, 2015 06:09
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be cool to have a config for this.
Especially for servers which are hosted on big server providers without the ability to change the systems locale.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah, the server's default locale is in a separate option so that something like that can be done without a ton of difficulty.

@zml2008 zml2008 force-pushed the feature/translations branch from 4f27696 to e5cbe29 Compare April 12, 2015 15:55
@ST-DDT
Copy link
Member

ST-DDT commented Apr 12, 2015

@zml2008 Could you please show me where the server side translations (ex from resource bundles) are converted into something that is send to the client?
Something like this:

Text.Translatable translatable = ...;
Translation translation = translatable.getTranslation();
if (translation instanceof ClientTranslation) { // or registry.isClientTranslation(translation))
    // ClientTranslation is a translation that will take place client side
    client.sendChatComponent(new TranslationTextComponent(
        translation.getId(), 
        wrapArguments(translatable.getArguments())
        ));
} else {
    // otherwise resolve the translation on the Server side
    client.sendChatComponent(new TranslationTextComponent(
    // client.sendChatComponent(new ArgumentsTextComponent(
        translation.get(client.mpplayer$getLocale()), 
        wrapArguments(translatable.getArguments())
        ));
}

@zml2008
Copy link
Member Author

zml2008 commented Apr 12, 2015

@ST-DDT
Copy link
Member

ST-DDT commented Apr 12, 2015

Thanks

@zml2008 zml2008 force-pushed the feature/translations branch from f6ed956 to b893624 Compare April 20, 2015 23:27
@zml2008 zml2008 closed this in 032f57a Apr 21, 2015
@zml2008 zml2008 deleted the feature/translations branch April 22, 2015 00:26
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants