Skip to content
This repository has been archived by the owner on Nov 16, 2024. It is now read-only.

Updated locale strings #6

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions js/forum/src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { extend } from 'flarum/extend';
import TextEditor from 'flarum/components/TextEditor';
import Button from 'flarum/components/Button';

app.initializers.add('matpompili-imgur-upload', function() {
app.initializers.add('flarum-imgur-upload', function() {
/*
* This add the Attach button and move the preview button, if it is
* there, to the end of the button list
Expand All @@ -20,7 +20,7 @@ app.initializers.add('matpompili-imgur-upload', function() {
items.add('imgur-upload', (
<div class="Button hasIcon imgur-upload-button">
<i class="icon fa fa-fw fa-paperclip Button-icon"></i>
<span class="Button-label">{app.translator.trans('matpompili-imgur-upload.forum.attach')}</span>
<span class="Button-label">{app.translator.trans('flarum-imgur-upload.forum.attach')}</span>
<input type="file" accept="image/*" id="imgur-upload-input" name="imgur-upload-input"></input>
</div>
));
Expand Down Expand Up @@ -55,7 +55,7 @@ app.initializers.add('matpompili-imgur-upload', function() {
var submitButton = $(".item-submit > button");
//Show a loading icon and a loading text
icon.removeClass('fa-paperclip').addClass('fa-spin fa-circle-o-notch');
buttonText.text(app.translator.trans('matpompili-imgur-upload.forum.loading')[0]);
buttonText.text(app.translator.trans('flarum-imgur-upload.forum.loading')[0]);
//Disable the submit button until the upload is completed
submitButton.attr("disabled", true);

Expand Down Expand Up @@ -102,7 +102,7 @@ app.initializers.add('matpompili-imgur-upload', function() {
success: function(response) {
//Remove the loading icon and text, and show the success
icon.removeClass('fa-spin fa-circle-o-notch').addClass('fa-check green');
buttonText.text(app.translator.trans('matpompili-imgur-upload.forum.loaded')[0]);
buttonText.text(app.translator.trans('flarum-imgur-upload.forum.loaded')[0]);
//Get the link to the uploaded image and put https instead of http
var linkString = '\n![alt text]('+response.data.link.replace('http:', 'https:')+')\n';
//Place the Markdown image link in the Composer
Expand All @@ -119,12 +119,12 @@ app.initializers.add('matpompili-imgur-upload', function() {
submitButton.attr("disabled", false);
//Restore the Attach button and text for a new upload
icon.removeClass('fa-check green').addClass('fa-paperclip');
buttonText.text(app.translator.trans('matpompili-imgur-upload.forum.attach')[0]);
buttonText.text(app.translator.trans('flarum-imgur-upload.forum.attach')[0]);
},1000);
}, error: function(response) {
//Remove the loading icon and text, and show the error
icon.removeClass('fa-spin fa-circle-o-notch').addClass('fa-times red');
buttonText.text(app.translator.trans('matpompili-imgur-upload.forum.error')[0]);
buttonText.text(app.translator.trans('flarum-imgur-upload.forum.error')[0]);
//Output the error to the console, for debug purposes
console.log(response);
//After 1sec
Expand All @@ -133,7 +133,7 @@ app.initializers.add('matpompili-imgur-upload', function() {
submitButton.attr("disabled", false);
//Restore the Attach button and text for a new upload
icon.removeClass('fa-times red').addClass('fa-paperclip');
buttonText.text(app.translator.trans('matpompili-imgur-upload.forum.attach')[0]);
buttonText.text(app.translator.trans('flarum-imgur-upload.forum.attach')[0]);
},1000);
}
});
Expand Down