mirror of
https://github.com/mastodon/mastodon.git
synced 2025-11-27 18:10:58 +00:00
Use the UI language as default compose language
This commit is contained in:
parent
429ab8d210
commit
c50cf3b544
|
|
@ -45,7 +45,7 @@ const messages = defineMessages({
|
|||
});
|
||||
|
||||
const mapStateToProps = (state) => ({
|
||||
currentLanguage: state.compose.get('language'),
|
||||
currentLanguage: state.meta.get('locale'),
|
||||
});
|
||||
|
||||
const languageDetectorInGlobalThis = 'LanguageDetector' in globalThis;
|
||||
|
|
@ -129,9 +129,10 @@ class ComposeForm extends ImmutablePureComponent {
|
|||
if (!languageDetector) {
|
||||
languageDetector = await globalThis.LanguageDetector.create();
|
||||
}
|
||||
const text = this.getFulltextForCharacterCounting();
|
||||
const text = this.getFulltextForCharacterCounting().trim();
|
||||
const currentLanguage = this.props.currentLanguage;
|
||||
if (!text || countLetters(text) <= 5) {
|
||||
console.log('hier', currentLanguage)
|
||||
this.props.dispatch(changeComposeLanguage(currentLanguage));
|
||||
return;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user