mirror of
https://framagit.org/tykayn/mastodon.git
synced 2023-08-25 08:33:12 +02:00
add word list fr
This commit is contained in:
parent
aec2561889
commit
6665db9e9c
Binary file not shown.
@ -35,7 +35,6 @@ const messages = defineMessages({
|
|||||||
follow_requests: { id: 'navigation_bar.follow_requests', defaultMessage: 'Follow requests' },
|
follow_requests: { id: 'navigation_bar.follow_requests', defaultMessage: 'Follow requests' },
|
||||||
lists: { id: 'navigation_bar.lists', defaultMessage: 'Lists' },
|
lists: { id: 'navigation_bar.lists', defaultMessage: 'Lists' },
|
||||||
keyboard_shortcuts: { id: 'navigation_bar.keyboard_shortcuts', defaultMessage: 'Keyboard shortcuts' },
|
keyboard_shortcuts: { id: 'navigation_bar.keyboard_shortcuts', defaultMessage: 'Keyboard shortcuts' },
|
||||||
lists: { id: 'navigation_bar.lists', defaultMessage: 'Lists' },
|
|
||||||
lists_subheading: { id: 'column_subheading.lists', defaultMessage: 'Lists' },
|
lists_subheading: { id: 'column_subheading.lists', defaultMessage: 'Lists' },
|
||||||
misc: { id: 'navigation_bar.misc', defaultMessage: 'Misc' },
|
misc: { id: 'navigation_bar.misc', defaultMessage: 'Misc' },
|
||||||
menu: { id: 'getting_started.heading', defaultMessage: 'Getting started' },
|
menu: { id: 'getting_started.heading', defaultMessage: 'Getting started' },
|
||||||
|
@ -4,6 +4,14 @@ const messages = {
|
|||||||
'navigation_bar.app_settings': 'Config de ouf',
|
'navigation_bar.app_settings': 'Config de ouf',
|
||||||
'tabs_bar.local_timeline': 'Bilveusées locales',
|
'tabs_bar.local_timeline': 'Bilveusées locales',
|
||||||
'tabs_bar.federated_timeline': 'La mine de sel',
|
'tabs_bar.federated_timeline': 'La mine de sel',
|
||||||
|
'compose_form.publish': getRandomTermPouet(),
|
||||||
|
'compose_form.save_changes': getRandomTermPouet(),
|
||||||
|
getRandomTermPouet:getRandomTermPouet,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export function getRandomTermPouet() {
|
||||||
|
let items = ['Pouet', 'Révolte', 'Couillère', 'Allez viens', 'On est bien', 'Sapristi', 'PWOUINNNN', 'Squalala', 'C\'est parti', 'Allez', 'Roulez jeunesse', 'Magnéto', 'Illuminer le monde'];
|
||||||
|
return items[Math.floor(Math.random() * items.length)];
|
||||||
|
}
|
||||||
|
|
||||||
export default Object.assign({}, inherited, messages);
|
export default Object.assign({}, inherited, messages);
|
||||||
|
@ -60,7 +60,7 @@
|
|||||||
background-position: top left;
|
background-position: top left;
|
||||||
background-attachment: fixed;
|
background-attachment: fixed;
|
||||||
background-repeat: no-repeat;
|
background-repeat: no-repeat;
|
||||||
background-size: cover;
|
background-size: 100vh;
|
||||||
.compose-panel{
|
.compose-panel{
|
||||||
//background-image: linear-gradient(transparent, #15141A 90%);
|
//background-image: linear-gradient(transparent, #15141A 90%);
|
||||||
}
|
}
|
||||||
@ -79,3 +79,8 @@
|
|||||||
margin-right: 2ch;
|
margin-right: 2ch;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
.skin-mastodon-light{
|
||||||
|
.navigation-bar__profile, strong{
|
||||||
|
color: white;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@ -22,6 +22,7 @@ import { length } from 'stringz';
|
|||||||
import { countableText } from '../util/counter';
|
import { countableText } from '../util/counter';
|
||||||
import Icon from 'mastodon/components/icon';
|
import Icon from 'mastodon/components/icon';
|
||||||
import { maxChars } from '../../../initial_state';
|
import { maxChars } from '../../../initial_state';
|
||||||
|
import { getRandomTermPouet } from '../../../../flavours/glitch/locales/fr';
|
||||||
|
|
||||||
const allowedAroundShortCode = '><\u0085\u0020\u00a0\u1680\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u2028\u2029\u0009\u000a\u000b\u000c\u000d';
|
const allowedAroundShortCode = '><\u0085\u0020\u00a0\u1680\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u2028\u2029\u0009\u000a\u000b\u000c\u000d';
|
||||||
|
|
||||||
@ -32,6 +33,7 @@ const messages = defineMessages({
|
|||||||
publishLoud: { id: 'compose_form.publish_loud', defaultMessage: '{publish}!' },
|
publishLoud: { id: 'compose_form.publish_loud', defaultMessage: '{publish}!' },
|
||||||
saveChanges: { id: 'compose_form.save_changes', defaultMessage: 'Save changes' },
|
saveChanges: { id: 'compose_form.save_changes', defaultMessage: 'Save changes' },
|
||||||
});
|
});
|
||||||
|
let publishText = '';
|
||||||
|
|
||||||
export default @injectIntl
|
export default @injectIntl
|
||||||
class ComposeForm extends ImmutablePureComponent {
|
class ComposeForm extends ImmutablePureComponent {
|
||||||
@ -74,17 +76,17 @@ class ComposeForm extends ImmutablePureComponent {
|
|||||||
|
|
||||||
handleChange = (e) => {
|
handleChange = (e) => {
|
||||||
this.props.onChange(e.target.value);
|
this.props.onChange(e.target.value);
|
||||||
}
|
};
|
||||||
|
|
||||||
handleKeyDown = (e) => {
|
handleKeyDown = (e) => {
|
||||||
if (e.keyCode === 13 && (e.ctrlKey || e.metaKey)) {
|
if (e.keyCode === 13 && (e.ctrlKey || e.metaKey)) {
|
||||||
this.handleSubmit();
|
this.handleSubmit();
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
|
|
||||||
getFulltextForCharacterCounting = () => {
|
getFulltextForCharacterCounting = () => {
|
||||||
return [this.props.spoiler ? this.props.spoilerText : '', countableText(this.props.text)].join('');
|
return [this.props.spoiler ? this.props.spoilerText : '', countableText(this.props.text)].join('');
|
||||||
}
|
};
|
||||||
|
|
||||||
canSubmit = () => {
|
canSubmit = () => {
|
||||||
const { isSubmitting, isChangingUpload, isUploading, anyMedia } = this.props;
|
const { isSubmitting, isChangingUpload, isUploading, anyMedia } = this.props;
|
||||||
@ -92,9 +94,11 @@ class ComposeForm extends ImmutablePureComponent {
|
|||||||
const isOnlyWhitespace = fulltext.length !== 0 && fulltext.trim().length === 0;
|
const isOnlyWhitespace = fulltext.length !== 0 && fulltext.trim().length === 0;
|
||||||
|
|
||||||
return !(isSubmitting || isUploading || isChangingUpload || length(fulltext) > maxChars || (isOnlyWhitespace && !anyMedia));
|
return !(isSubmitting || isUploading || isChangingUpload || length(fulltext) > maxChars || (isOnlyWhitespace && !anyMedia));
|
||||||
}
|
};
|
||||||
|
|
||||||
handleSubmit = (e) => {
|
handleSubmit = (e) => {
|
||||||
|
console.log('handle du submit');
|
||||||
|
|
||||||
if (this.props.text !== this.autosuggestTextarea.textarea.value) {
|
if (this.props.text !== this.autosuggestTextarea.textarea.value) {
|
||||||
// Something changed the text inside the textarea (e.g. browser extensions like Grammarly)
|
// Something changed the text inside the textarea (e.g. browser extensions like Grammarly)
|
||||||
// Update the state to match the current text
|
// Update the state to match the current text
|
||||||
@ -106,31 +110,30 @@ class ComposeForm extends ImmutablePureComponent {
|
|||||||
}
|
}
|
||||||
|
|
||||||
this.props.onSubmit(this.context.router ? this.context.router.history : null);
|
this.props.onSubmit(this.context.router ? this.context.router.history : null);
|
||||||
|
|
||||||
if (e) {
|
if (e) {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
|
|
||||||
onSuggestionsClearRequested = () => {
|
onSuggestionsClearRequested = () => {
|
||||||
this.props.onClearSuggestions();
|
this.props.onClearSuggestions();
|
||||||
}
|
};
|
||||||
|
|
||||||
onSuggestionsFetchRequested = (token) => {
|
onSuggestionsFetchRequested = (token) => {
|
||||||
this.props.onFetchSuggestions(token);
|
this.props.onFetchSuggestions(token);
|
||||||
}
|
};
|
||||||
|
|
||||||
onSuggestionSelected = (tokenStart, token, value) => {
|
onSuggestionSelected = (tokenStart, token, value) => {
|
||||||
this.props.onSuggestionSelected(tokenStart, token, value, ['text']);
|
this.props.onSuggestionSelected(tokenStart, token, value, ['text']);
|
||||||
}
|
};
|
||||||
|
|
||||||
onSpoilerSuggestionSelected = (tokenStart, token, value) => {
|
onSpoilerSuggestionSelected = (tokenStart, token, value) => {
|
||||||
this.props.onSuggestionSelected(tokenStart, token, value, ['spoiler_text']);
|
this.props.onSuggestionSelected(tokenStart, token, value, ['spoiler_text']);
|
||||||
}
|
};
|
||||||
|
|
||||||
handleChangeSpoilerText = (e) => {
|
handleChangeSpoilerText = (e) => {
|
||||||
this.props.onChangeSpoilerText(e.target.value);
|
this.props.onChangeSpoilerText(e.target.value);
|
||||||
}
|
};
|
||||||
|
|
||||||
handleFocus = () => {
|
handleFocus = () => {
|
||||||
if (this.composeForm && !this.props.singleColumn) {
|
if (this.composeForm && !this.props.singleColumn) {
|
||||||
@ -139,7 +142,7 @@ class ComposeForm extends ImmutablePureComponent {
|
|||||||
this.composeForm.scrollIntoView();
|
this.composeForm.scrollIntoView();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
|
|
||||||
componentDidMount() {
|
componentDidMount() {
|
||||||
this._updateFocusAndSelection({});
|
this._updateFocusAndSelection({});
|
||||||
@ -185,15 +188,15 @@ class ComposeForm extends ImmutablePureComponent {
|
|||||||
this.autosuggestTextarea.textarea.focus();
|
this.autosuggestTextarea.textarea.focus();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
|
|
||||||
setAutosuggestTextarea = (c) => {
|
setAutosuggestTextarea = (c) => {
|
||||||
this.autosuggestTextarea = c;
|
this.autosuggestTextarea = c;
|
||||||
}
|
};
|
||||||
|
|
||||||
setSpoilerText = (c) => {
|
setSpoilerText = (c) => {
|
||||||
this.spoilerText = c;
|
this.spoilerText = c;
|
||||||
}
|
};
|
||||||
|
|
||||||
setRef = c => {
|
setRef = c => {
|
||||||
this.composeForm = c;
|
this.composeForm = c;
|
||||||
@ -205,21 +208,34 @@ class ComposeForm extends ImmutablePureComponent {
|
|||||||
const needsSpace = data.custom && position > 0 && !allowedAroundShortCode.includes(text[position - 1]);
|
const needsSpace = data.custom && position > 0 && !allowedAroundShortCode.includes(text[position - 1]);
|
||||||
|
|
||||||
this.props.onPickEmoji(position, data, needsSpace);
|
this.props.onPickEmoji(position, data, needsSpace);
|
||||||
}
|
};
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
const { intl, onPaste, showSearch } = this.props;
|
const { intl, onPaste, showSearch } = this.props;
|
||||||
const disabled = this.props.isSubmitting;
|
const disabled = this.props.isSubmitting;
|
||||||
|
|
||||||
let publishText = '';
|
|
||||||
|
|
||||||
|
const locale = document.documentElement.lang;
|
||||||
|
|
||||||
|
console.log('is editing', this.props.isEditing);
|
||||||
|
|
||||||
|
|
||||||
|
if (locale === 'fr') {
|
||||||
|
let items = ['Pouet', 'Révolte', 'Couillère', 'Allez viens', 'On est bien', 'Sapristi', 'PWOUINNNN', 'Squalala', 'C\'est parti', 'Allez', 'Roulez jeunesse', 'Magnéto', 'Illuminer le monde'];
|
||||||
|
|
||||||
|
publishText = items[Math.floor(Math.random() * items.length)];
|
||||||
|
}else{
|
||||||
if (this.props.isEditing) {
|
if (this.props.isEditing) {
|
||||||
publishText = intl.formatMessage(messages.saveChanges);
|
publishText = intl.formatMessage(messages.saveChanges);
|
||||||
|
|
||||||
|
|
||||||
} else if (this.props.privacy === 'private' || this.props.privacy === 'direct') {
|
} else if (this.props.privacy === 'private' || this.props.privacy === 'direct') {
|
||||||
publishText = <span className='compose-form__publish-private'><Icon id='lock' /> {intl.formatMessage(messages.publish)}</span>;
|
publishText =
|
||||||
|
<span className='compose-form__publish-private'><Icon id='lock' /> {intl.formatMessage(messages.publish)}</span>;
|
||||||
} else {
|
} else {
|
||||||
publishText = this.props.privacy !== 'unlisted' ? intl.formatMessage(messages.publishLoud, { publish: intl.formatMessage(messages.publish) }) : intl.formatMessage(messages.publish);
|
publishText = this.props.privacy !== 'unlisted' ? intl.formatMessage(messages.publishLoud, { publish: intl.formatMessage(messages.publish) }) : intl.formatMessage(messages.publish);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<form className='compose-form' onSubmit={this.handleSubmit}>
|
<form className='compose-form' onSubmit={this.handleSubmit}>
|
||||||
@ -297,3 +313,4 @@ class ComposeForm extends ImmutablePureComponent {
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user