Merge remote-tracking branch 'misskey-original/develop' into develop
# Conflicts: # package.json # packages/frontend/src/components/MkEmojiPicker.vue # packages/frontend/src/components/global/MkMisskeyFlavoredMarkdown.ts # packages/frontend/src/pages/about.emojis.vue # packages/frontend/src/pages/custom-emojis-manager.vue
This commit is contained in:
commit
7e155917e7
62 changed files with 1629 additions and 728 deletions
|
|
@ -9,6 +9,7 @@ import { $i } from '@/account.js';
|
|||
import { miLocalStorage } from '@/local-storage.js';
|
||||
import { customEmojis } from '@/custom-emojis.js';
|
||||
import { url, lang } from '@/config.js';
|
||||
import { nyaize } from '@/scripts/nyaize.js';
|
||||
|
||||
export function createAiScriptEnv(opts) {
|
||||
return {
|
||||
|
|
@ -71,5 +72,9 @@ export function createAiScriptEnv(opts) {
|
|||
'Mk:url': values.FN_NATIVE(() => {
|
||||
return values.STR(window.location.href);
|
||||
}),
|
||||
'Mk:nyaize': values.FN_NATIVE(([text]) => {
|
||||
utils.assertString(text);
|
||||
return values.STR(nyaize(text.value));
|
||||
}),
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,12 +6,41 @@
|
|||
import { lang } from '@/config.js';
|
||||
|
||||
export const versatileLang = (lang ?? 'ja-JP').replace('ja-KS', 'ja-JP');
|
||||
export const dateTimeFormat = new Intl.DateTimeFormat(versatileLang, {
|
||||
year: 'numeric',
|
||||
month: 'numeric',
|
||||
day: 'numeric',
|
||||
hour: 'numeric',
|
||||
minute: 'numeric',
|
||||
second: 'numeric',
|
||||
});
|
||||
export const numberFormat = new Intl.NumberFormat(versatileLang);
|
||||
|
||||
let _dateTimeFormat: Intl.DateTimeFormat;
|
||||
try {
|
||||
_dateTimeFormat = new Intl.DateTimeFormat(versatileLang, {
|
||||
year: 'numeric',
|
||||
month: 'numeric',
|
||||
day: 'numeric',
|
||||
hour: 'numeric',
|
||||
minute: 'numeric',
|
||||
second: 'numeric',
|
||||
});
|
||||
} catch (err) {
|
||||
console.warn(err);
|
||||
if (_DEV_) console.log('[Intl] Fallback to en-US');
|
||||
|
||||
// Fallback to en-US
|
||||
_dateTimeFormat = new Intl.DateTimeFormat('en-US', {
|
||||
year: 'numeric',
|
||||
month: 'numeric',
|
||||
day: 'numeric',
|
||||
hour: 'numeric',
|
||||
minute: 'numeric',
|
||||
second: 'numeric',
|
||||
});
|
||||
}
|
||||
export const dateTimeFormat = _dateTimeFormat;
|
||||
|
||||
let _numberFormat: Intl.NumberFormat;
|
||||
try {
|
||||
_numberFormat = new Intl.NumberFormat(versatileLang);
|
||||
} catch (err) {
|
||||
console.warn(err);
|
||||
if (_DEV_) console.log('[Intl] Fallback to en-US');
|
||||
|
||||
// Fallback to en-US
|
||||
_numberFormat = new Intl.NumberFormat('en-US');
|
||||
}
|
||||
export const numberFormat = _numberFormat;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue