mirror of
https://github.com/mastodon/mastodon.git
synced 2025-11-28 02:20:47 +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) => ({
|
const mapStateToProps = (state) => ({
|
||||||
currentLanguage: state.compose.get('language'),
|
currentLanguage: state.meta.get('locale'),
|
||||||
});
|
});
|
||||||
|
|
||||||
const languageDetectorInGlobalThis = 'LanguageDetector' in globalThis;
|
const languageDetectorInGlobalThis = 'LanguageDetector' in globalThis;
|
||||||
|
|
@ -129,9 +129,10 @@ class ComposeForm extends ImmutablePureComponent {
|
||||||
if (!languageDetector) {
|
if (!languageDetector) {
|
||||||
languageDetector = await globalThis.LanguageDetector.create();
|
languageDetector = await globalThis.LanguageDetector.create();
|
||||||
}
|
}
|
||||||
const text = this.getFulltextForCharacterCounting();
|
const text = this.getFulltextForCharacterCounting().trim();
|
||||||
const currentLanguage = this.props.currentLanguage;
|
const currentLanguage = this.props.currentLanguage;
|
||||||
if (!text || countLetters(text) <= 5) {
|
if (!text || countLetters(text) <= 5) {
|
||||||
|
console.log('hier', currentLanguage)
|
||||||
this.props.dispatch(changeComposeLanguage(currentLanguage));
|
this.props.dispatch(changeComposeLanguage(currentLanguage));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user