mirror of
https://github.com/Rafostar/clapper.git
synced 2025-08-30 16:02:00 +02:00
Merge pull request #275 from Rafostar/smart-colon
Use U+003A colon character on RTL languages
This commit is contained in:
@@ -165,7 +165,7 @@ class ClapperElapsedTimeButton extends PopoverButtonBase
|
|||||||
|
|
||||||
setInitialState()
|
setInitialState()
|
||||||
{
|
{
|
||||||
this.label = '00∶00∕00∶00';
|
this.label = `00${Misc.timeColon}00∕00${Misc.timeColon}00`;
|
||||||
}
|
}
|
||||||
|
|
||||||
setFullscreenMode(isFullscreen, isMobileMonitor)
|
setFullscreenMode(isFullscreen, isMobileMonitor)
|
||||||
|
2
src/controls.js
vendored
2
src/controls.js
vendored
@@ -27,7 +27,7 @@ class ClapperControls extends Gtk.Box
|
|||||||
this.isMobile = false;
|
this.isMobile = false;
|
||||||
|
|
||||||
this.showHours = false;
|
this.showHours = false;
|
||||||
this.durationFormatted = '00∶00';
|
this.durationFormatted = `00${Misc.timeColon}00`;
|
||||||
this.revealersArr = [];
|
this.revealersArr = [];
|
||||||
this.chapters = null;
|
this.chapters = null;
|
||||||
|
|
||||||
|
@@ -10,6 +10,7 @@ Debug.debug('imports');
|
|||||||
|
|
||||||
const { GstClapper, Gtk, Adw } = imports.gi;
|
const { GstClapper, Gtk, Adw } = imports.gi;
|
||||||
const { App } = imports.src.app;
|
const { App } = imports.src.app;
|
||||||
|
const Misc = imports.src.misc;
|
||||||
|
|
||||||
function main(argv)
|
function main(argv)
|
||||||
{
|
{
|
||||||
@@ -19,6 +20,10 @@ function main(argv)
|
|||||||
Gtk.init();
|
Gtk.init();
|
||||||
Adw.init();
|
Adw.init();
|
||||||
|
|
||||||
|
/* U+2236 seems to break RTL languages, use U+003A instead */
|
||||||
|
if(Gtk.Widget.get_default_direction() === Gtk.TextDirection.RTL)
|
||||||
|
Misc.timeColon = ':';
|
||||||
|
|
||||||
Debug.debug('initialized');
|
Debug.debug('initialized');
|
||||||
|
|
||||||
new App().run(argv);
|
new App().run(argv);
|
||||||
|
@@ -9,6 +9,7 @@ var subsMimes = [
|
|||||||
'application/x-subrip',
|
'application/x-subrip',
|
||||||
'text/x-ssa',
|
'text/x-ssa',
|
||||||
];
|
];
|
||||||
|
var timeColon = '∶';
|
||||||
|
|
||||||
var settings = new Gio.Settings({
|
var settings = new Gio.Settings({
|
||||||
schema_id: appId,
|
schema_id: appId,
|
||||||
@@ -161,8 +162,8 @@ function getFormattedTime(time, showHours)
|
|||||||
time -= minutes * 60;
|
time -= minutes * 60;
|
||||||
const seconds = ('0' + Math.floor(time)).slice(-2);
|
const seconds = ('0' + Math.floor(time)).slice(-2);
|
||||||
|
|
||||||
const parsed = (hours) ? `${hours}∶` : '';
|
const parsed = (hours) ? `${hours}${timeColon}` : '';
|
||||||
return parsed + `${minutes}∶${seconds}`;
|
return parsed + `${minutes}${timeColon}${seconds}`;
|
||||||
}
|
}
|
||||||
|
|
||||||
function parsePlaylistFiles(filesArray)
|
function parsePlaylistFiles(filesArray)
|
||||||
|
@@ -59,8 +59,8 @@ class ClapperRevealerTop extends CustomRevealer
|
|||||||
|
|
||||||
const initTime = GLib.DateTime.new_now_local().format('%X');
|
const initTime = GLib.DateTime.new_now_local().format('%X');
|
||||||
this.timeFormat = (initTime.length > 8)
|
this.timeFormat = (initTime.length > 8)
|
||||||
? '%I∶%M %p'
|
? `%I${Misc.timeColon}%M %p`
|
||||||
: '%H∶%M';
|
: `%H${Misc.timeColon}%M`;
|
||||||
|
|
||||||
this.mediaTitle = new Gtk.Label({
|
this.mediaTitle = new Gtk.Label({
|
||||||
ellipsize: Pango.EllipsizeMode.END,
|
ellipsize: Pango.EllipsizeMode.END,
|
||||||
|
Reference in New Issue
Block a user