mirror of
https://github.com/flarum/core.git
synced 2025-08-06 16:36:47 +02:00
fix: caught warnings and missing locale
This commit is contained in:
@@ -84,15 +84,10 @@ export default class Translator {
|
||||
const elements = translation.match(/<(\w+)[^>]*>.*?<\/\1>/g);
|
||||
const tags = elements?.map((element) => element.match(/^<(\w+)/)![1]) || [];
|
||||
|
||||
for (const tag of tags) {
|
||||
if (!parameters[tag]) {
|
||||
fireDebugWarning(
|
||||
`Any HTML tags used within translations must have corresponding mithril component parameters.\nCaught in translation: \n\n"""\n${translation}\n"""`,
|
||||
'',
|
||||
'v2.0',
|
||||
'flarum/framework'
|
||||
);
|
||||
const autoProvidedTags = this.autoProvidedTags();
|
||||
|
||||
for (const tag of tags) {
|
||||
if (!parameters[tag] && autoProvidedTags.includes(tag)) {
|
||||
parameters[tag] = ({ children }: any) => m(tag, children);
|
||||
}
|
||||
}
|
||||
@@ -186,4 +181,8 @@ export default class Translator {
|
||||
|
||||
return translation;
|
||||
}
|
||||
|
||||
autoProvidedTags(): string[] {
|
||||
return ['strong', 'code', 'i', 's', 'em', 'sup', 'sub'];
|
||||
}
|
||||
}
|
||||
|
@@ -22,20 +22,20 @@ export default class Pagination<CustomAttrs extends IPaginationInterface = IPagi
|
||||
<nav className="Pagination">
|
||||
<Button
|
||||
disabled={currentPage === 1}
|
||||
title={app.translator.trans('core.admin.users.pagination.first_page_button')}
|
||||
title={app.translator.trans('core.lib.pagination.first_button')}
|
||||
onclick={() => onChange(1)}
|
||||
icon="fas fa-step-backward"
|
||||
className="Button Button--icon Pagination-first"
|
||||
/>
|
||||
<Button
|
||||
disabled={currentPage === 1}
|
||||
title={app.translator.trans('core.admin.users.pagination.back_button')}
|
||||
title={app.translator.trans('core.lib.pagination.back_button')}
|
||||
onclick={() => onChange(currentPage - 1)}
|
||||
icon="fas fa-chevron-left"
|
||||
className="Button Button--icon Pagination-back"
|
||||
/>
|
||||
<span className="Pagination-pageNumber">
|
||||
{app.translator.trans('core.admin.users.pagination.page_counter', {
|
||||
{app.translator.trans('core.lib.pagination.page_counter', {
|
||||
// https://technology.blog.gov.uk/2020/02/24/why-the-gov-uk-design-system-team-changed-the-input-type-for-numbers/
|
||||
current: (
|
||||
<input
|
||||
@@ -43,7 +43,7 @@ export default class Pagination<CustomAttrs extends IPaginationInterface = IPagi
|
||||
inputmode="numeric"
|
||||
pattern="[0-9]*"
|
||||
value={loadingPageNumber ?? currentPage}
|
||||
aria-label={extractText(app.translator.trans('core.admin.users.pagination.go_to_page_textbox_a11y_label'))}
|
||||
aria-label={extractText(app.translator.trans('core.lib.pagination.go_to_page_textbox_a11y_label'))}
|
||||
autocomplete="off"
|
||||
className="FormControl Pagination-input"
|
||||
onchange={(e: InputEvent) => {
|
||||
@@ -76,14 +76,14 @@ export default class Pagination<CustomAttrs extends IPaginationInterface = IPagi
|
||||
</span>
|
||||
<Button
|
||||
disabled={!moreData}
|
||||
title={app.translator.trans('core.admin.users.pagination.next_button')}
|
||||
title={app.translator.trans('core.lib.pagination.next_button')}
|
||||
onclick={() => onChange(currentPage + 1)}
|
||||
icon="fas fa-chevron-right"
|
||||
className="Button Button--icon Pagination-next"
|
||||
/>
|
||||
<Button
|
||||
disabled={!moreData}
|
||||
title={app.translator.trans('core.admin.users.pagination.last_page_button')}
|
||||
title={app.translator.trans('core.lib.pagination.last_button')}
|
||||
onclick={() => onChange(totalPageCount)}
|
||||
icon="fas fa-step-forward"
|
||||
className="Button Button--icon Pagination-last"
|
||||
|
Reference in New Issue
Block a user