mirror of
https://github.com/flarum/framework.git
synced 2025-02-21 09:11:40 +08:00
fix: caught warnings and missing locale
This commit is contained in:
parent
30c7602814
commit
4715293164
@ -14,16 +14,12 @@ export default [
|
||||
.setting(() => ({
|
||||
setting: 'flarum-extension-manager.queue_jobs',
|
||||
label: app.translator.trans('flarum-extension-manager.admin.settings.queue_jobs'),
|
||||
help: m.trust(
|
||||
extractText(
|
||||
app.translator.trans('flarum-extension-manager.admin.settings.queue_jobs_help', {
|
||||
basic_impl_link: 'https://discuss.flarum.org/d/28151-database-queue-the-simplest-queue-even-for-shared-hosting',
|
||||
adv_impl_link: 'https://discuss.flarum.org/d/21873-redis-sessions-cache-queues',
|
||||
php_version: `<strong>${app.data.phpVersion}</strong>`,
|
||||
folder_perms_link: 'https://docs.flarum.org/install#folder-ownership',
|
||||
})
|
||||
)
|
||||
),
|
||||
help: app.translator.trans('flarum-extension-manager.admin.settings.queue_jobs_help', {
|
||||
basic_impl_link: <a href="https://discuss.flarum.org/d/28151-database-queue-the-simplest-queue-even-for-shared-hosting" />,
|
||||
adv_impl_link: <a href="https://discuss.flarum.org/d/21873-redis-sessions-cache-queues" />,
|
||||
php_version: <strong>{app.data.phpVersion}</strong>,
|
||||
folder_perms_link: <a href="https://docs.flarum.org/install#folder-ownership" />,
|
||||
}),
|
||||
type: 'boolean',
|
||||
disabled: app.data['flarum-extension-manager.using_sync_queue'],
|
||||
}))
|
||||
|
@ -128,6 +128,7 @@ flarum-extension-manager:
|
||||
party_filter:
|
||||
all: All
|
||||
premium: Premium
|
||||
toggle_dropdown_accessible_label: Toggle party filter
|
||||
queue:
|
||||
columns:
|
||||
details: Details
|
||||
@ -169,8 +170,8 @@ flarum-extension-manager:
|
||||
debug_mode_warning: You are running in debug mode, the extension manager cannot properly install and update local development packages. Please use the command line interface instead for such purposes.
|
||||
queue_jobs: Run operations in the background queue
|
||||
queue_jobs_help: >
|
||||
You can read about a <a href='{basic_impl_link}'>basic queue</a> implementation or a <a href='{adv_impl_link}'>more advanced</a> one.
|
||||
Make sure the PHP version used for the queue is {php_version}. Make sure <a href='{folder_perms_link}'>folder permissions</a> are correctly configured.
|
||||
You can read about a <basic_impl_link>basic queue</basic_impl_link> implementation or a <adv_impl_link>more advanced</adv_impl_link> one.
|
||||
Make sure the PHP version used for the queue is {php_version}. Make sure <folder_perms_link>folder permissions</folder_perms_link> are correctly configured.
|
||||
task_retention_days: Task retention days
|
||||
task_retention_days_help: >
|
||||
The number of days to keep completed tasks in the database. Tasks older than this will be deleted.
|
||||
|
@ -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"
|
||||
|
@ -385,14 +385,6 @@ core:
|
||||
|
||||
invalid_column_content: Invalid
|
||||
|
||||
pagination:
|
||||
back_button: Previous page
|
||||
first_button: Go to first page
|
||||
go_to_page_textbox_a11y_label: Go directly to page number
|
||||
last_button: Go to last page
|
||||
next_button: Next page
|
||||
page_counter: Page {current} of {total}
|
||||
|
||||
search_placeholder: => core.ref.search_users
|
||||
title: => core.ref.users
|
||||
total_users: "Total users: {count}"
|
||||
@ -802,6 +794,15 @@ core:
|
||||
kilo_text: K
|
||||
mega_text: M
|
||||
|
||||
# These translations are used in the common pagination component.
|
||||
pagination:
|
||||
back_button: Previous page
|
||||
first_button: Go to first page
|
||||
go_to_page_textbox_a11y_label: Go directly to page number
|
||||
last_button: Go to last page
|
||||
next_button: Next page
|
||||
page_counter: Page {current} of {total}
|
||||
|
||||
# These translations are used by the abstract search component and search modal.
|
||||
search:
|
||||
gambit_plus_button_a11y_label: Add a positive filter
|
||||
|
Loading…
x
Reference in New Issue
Block a user