How to use the react-i18nify.t function in react-i18nify

To help you get started, we’ve selected a few react-i18nify examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github zhw2590582 / SubPlayer / src / components / App.js View on Github external
this.updateSubtitles(subtitles, true).then(() => {
                            toastr.success(t('translate'));
                        });
                    })
github zhw2590582 / SubPlayer / src / components / App.js View on Github external
this.updateSubtitles([], true).then(() => {
            toastr.success(t('removeAll'));
        });
    }
github zhw2590582 / SubPlayer / src / components / App.js View on Github external
this.updateSubtitles(subtitles, true).then(() => {
            toastr.success(t('delete'));
        });
    }
github zhw2590582 / SubPlayer / src / components / App.js View on Github external
downloadSubtitles() {
        downloadFile(vttToUrl(arrToVtt(this.state.subtitles)), `${Date.now()}.vtt`);
        toastr.success(t('download'));
    }
github zhw2590582 / SubPlayer / src / components / Subtitle.js View on Github external
check() {
        const { index, subtitle } = this.state;
        const { subtitles } = this.props;
        const startTime = timeToSecond(subtitle.start);
        const endTime = timeToSecond(subtitle.end);
        const previous = subtitles[index - 1];
        const next = subtitles[index + 1];

        if (index !== -1) {
            if (!checkTime(subtitle.start)) {
                toastr.error(t('startTime'));
                return false;
            }

            if (!checkTime(subtitle.end)) {
                toastr.error(t('endTime'));
                return false;
            }

            if (startTime >= endTime) {
                toastr.error(t('greater'));
                return false;
            }

            if ((previous && endTime < previous.startTime) || (next && startTime > next.endTime)) {
                toastr.error(t('moveAcross'));
                return false;
            }

            if (previous && startTime < previous.endTime) {
                toastr.warning(t('overlaps'));
            }
github zhw2590582 / SubPlayer / src / components / App.js View on Github external
this.updateSubtitles(subtitles, true).then(() => {
            toastr.success(t('delete'));
        });
    }
github zhw2590582 / SubPlayer / src / components / Waveform.js View on Github external
async getCanvasData() {
        toastr.warning(t('waveformBuildStart'));
        const canvasData = await wavesurfer({
            height: timelineHeight,
            videoUrl: this.props.videoUrl,
            minPxPerSec: this.props.grid * 10,
            maxCanvasWidth: (this.props.mainWidth - this.props.grid * 10),
        });
        if (canvasData.length) {
            this.canvasData = canvasData;
            const $waveform = this.$waveform.current;
            const ctx = $waveform.getContext('2d');
            ctx.clearRect(0, 0, $waveform.width, $waveform.height);
            ctx.putImageData(this.canvasData[this.canvasIndex], this.props.grid * 5, 0);
            toastr.success(t('waveformBuildEnd'));
        }
    }
github zhw2590582 / SubPlayer / src / components / App.js View on Github external
if (this.state.subtitles.length <= 1000) {
                this.inTranslation = true;
                translate(this.state.subtitles, land, translator)
                    .then(subtitles => {
                        this.inTranslation = false;
                        this.updateSubtitles(subtitles, true).then(() => {
                            toastr.success(t('translate'));
                        });
                    })
                    .catch(error => {
                        toastr.error(error.message);
                        this.inTranslation = false;
                        throw error;
                    });
            } else {
                toastr.error(t('translateLenght'));
            }
        } else {
            toastr.error(t('translateProgress'));
        }
    }
github zhw2590582 / SubPlayer / src / components / App.js View on Github external
this.updateSubtitles(subtitles, true).then(() => {
            toastr.success(t('removeEmpty'));
        });
    }
github zhw2590582 / SubPlayer / src / components / App.js View on Github external
this.updateSubtitles(subtitles, true).then(() => {
                            toastr.success(t('translate'));
                        });
                    })