Make quote partial prefix/suffix translatable

This commit is contained in:
Tetrakern 2024-11-28 16:25:30 +01:00
parent 7b2328ccba
commit 12ee20cde4
4 changed files with 10 additions and 6 deletions

View File

@ -2020,6 +2020,10 @@ function fictioneer_get_js_translations() {
'oauthAccountAlreadyLinked' => __( 'Account already linked to another profile.', 'fictioneer' ), 'oauthAccountAlreadyLinked' => __( 'Account already linked to another profile.', 'fictioneer' ),
'oauthNew' => __( 'Your account has been successfully linked. <strong>Hint:</strong> You can change your display name in your profile and link additional accounts.', 'fictioneer' ), 'oauthNew' => __( 'Your account has been successfully linked. <strong>Hint:</strong> You can change your display name in your profile and link additional accounts.', 'fictioneer' ),
'oauthAccountLinked' => __( 'Account has been successfully linked.', 'fictioneer' ) 'oauthAccountLinked' => __( 'Account has been successfully linked.', 'fictioneer' )
),
'partial' => array(
'quoteFragmentPrefix' => _x( '[…] ', 'Prefix for partial quotes', 'fictioneer' ),
'quoteFragmentSuffix' => _x( ' […]', 'Suffix for partial quotes', 'fictioneer' )
) )
); );
} }

2
js/chapter.min.js vendored

File diff suppressed because one or more lines are too long

6
js/complete.min.js vendored

File diff suppressed because one or more lines are too long

View File

@ -139,8 +139,8 @@ function fcn_getQuote(e) {
const anchor = `[anchor]${e.target.closest('p[data-paragraph-id]').id}[/anchor]`; const anchor = `[anchor]${e.target.closest('p[data-paragraph-id]').id}[/anchor]`;
let quote = e.target.closest('p[data-paragraph-id]').querySelector('.paragraph-inner').innerText; let quote = e.target.closest('p[data-paragraph-id]').querySelector('.paragraph-inner').innerText;
let pre = '[…] '; let pre = fictioneer_tl.partial.quoteFragmentPrefix;
let suf = ' […]'; let suf = fictioneer_tl.partial.quoteFragmentSuffix;
// Build from text selection and add ellipsis if necessary // Build from text selection and add ellipsis if necessary
if (quote.length > 16 && selection.replace(/\s/g, '').length) { if (quote.length > 16 && selection.replace(/\s/g, '').length) {