Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[4.x] fix some translations #9361

Merged
merged 12 commits into from
Jan 19, 2024
2 changes: 1 addition & 1 deletion resources/js/components/fieldtypes/IconFieldtype.vue
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
:name="name"
:disabled="config.disabled || isReadOnly"
:options="options"
:placeholder="__(config.placeholder || 'Search ...')"
:placeholder="__(config.placeholder || 'Search...')"
:searchable="true"
:multiple="false"
:close-on-select="true"
Expand Down
2 changes: 1 addition & 1 deletion resources/js/components/fieldtypes/SlugFieldtype.vue
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
@blur="$emit('blur')"
>
<template v-slot:append v-if="config.show_regenerate">
<button class="input-group-append items-center flex" @click="sync" v-tooltip="__('Regenerate from: ' + config.from)">
<button class="input-group-append items-center flex" @click="sync" v-tooltip="__('Regenerate from: :field', { 'field': config.from })">
<svg-icon name="light/synchronize" class="w-5 h-5" />
</button>
</template>
Expand Down
4 changes: 2 additions & 2 deletions resources/js/components/fieldtypes/bard/LinkToolbar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
type="text"
ref="urlInput"
class="input h-auto text-sm"
placeholder="URL"
:placeholder="__('URL')"
@keydown.enter.prevent="commit"
/>

Expand All @@ -39,7 +39,7 @@
type="text"
ref="mailtoInput"
class="input h-auto text-sm"
placeholder="Email Address"
:placeholder="__('Email Address')"
@keydown.enter.prevent="commit"
/>

Expand Down
4 changes: 2 additions & 2 deletions resources/js/components/globals/Sites.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
<table class="grid-table">
<thead>
<tr>
<th>Site</th>
<th>Origin</th>
<th>{{ __('Site') }}</th>
<th>{{ __('Origin') }}</th>
</tr>
</thead>
<tbody>
Expand Down
6 changes: 6 additions & 0 deletions resources/lang/en/messages.php
Original file line number Diff line number Diff line change
Expand Up @@ -234,4 +234,10 @@
'user_wizard_roles_groups_intro' => 'Users can be assigned to roles that customize their permissions, access, and abilities throughout the Control Panel.',
'user_wizard_super_admin_instructions' => 'Super admins have complete control and access to everything in the control panel. Grant this role wisely.',
'view_more_count' => 'View :count more',
'units.B' => ':count B',
'units.KB' => ':count KB',
'units.MB' => ':count MB',
'units.GB' => ':count GB',
'units.s' => ':counts',
'units.ms' => ':countms',
];
4 changes: 2 additions & 2 deletions resources/views/licensing.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
</div>
@endif

<h6 class="mt-8">Site</h6>
<h6 class="mt-8">{{ __('Site') }}</h6>
<div class="card p-0 mt-2">
<table class="data-table">
<tr>
Expand All @@ -64,7 +64,7 @@
</table>
</div>

<h6 class="mt-8">Core</h6>
<h6 class="mt-8">{{ __('Core') }}</h6>
<div class="card p-0 mt-2">
<table class="data-table">
<tr>
Expand Down
2 changes: 1 addition & 1 deletion resources/views/updater/index.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class="btn-primary btn-lg">{{ __('Try again') }}</a>
<h1 class="flex-1">{{ __('Updates') }}</h1>
</div>

<h6 class="mt-8">Core</h6>
<h6 class="mt-8">{{ __('Core') }}</h6>
<div class="card p-0 mt-2">
<table class="data-table">
<tr>
Expand Down
4 changes: 2 additions & 2 deletions src/Auth/UserRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,10 @@ public function blueprint()
}

$blueprint = Blueprint::find('user') ?? Blueprint::makeFromFields([
'name' => ['type' => 'text', 'display' => 'Name', 'listable' => true],
'name' => ['type' => 'text', 'display' => __('Name'), 'listable' => true],
])->setHandle('user');

$blueprint->ensureField('email', ['type' => 'text', 'input_type' => 'email', 'display' => 'Email Address', 'listable' => true]);
$blueprint->ensureField('email', ['type' => 'text', 'input_type' => 'email', 'display' => __('Email Address'), 'listable' => true]);

if (Statamic::pro()) {
$blueprint->ensureField('roles', ['type' => 'user_roles', 'mode' => 'select', 'width' => 50, 'listable' => true, 'filterable' => false]);
Expand Down
2 changes: 1 addition & 1 deletion src/Http/Controllers/CP/Users/UsersController.php
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ public function edit(Request $request, $user)
}

if (User::current()->isSuper() && User::current()->id() !== $user->id()) {
$blueprint->ensureField('super', ['type' => 'toggle']);
$blueprint->ensureField('super', ['type' => 'toggle', 'display' => __('permissions.super')]);
}

$values = $user->data()
Expand Down
2 changes: 1 addition & 1 deletion src/Preferences/CorePreferences.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ public function boot()
[
'handle' => 'url',
'field' => [
'display' => 'URL',
'display' => __('URL'),
'type' => 'text',
],
],
Expand Down
18 changes: 6 additions & 12 deletions src/Support/Str.php
Original file line number Diff line number Diff line change
Expand Up @@ -139,29 +139,23 @@ public static function deslugify($string)
public static function fileSizeForHumans($bytes, $decimals = 2)
{
if ($bytes >= 1073741824) {
$bytes = number_format($bytes / 1073741824, $decimals).' GB';
return trans_choice('statamic::messages.units.GB', number_format($bytes / 1073741824, $decimals));
} elseif ($bytes >= 1048576) {
$bytes = number_format($bytes / 1048576, $decimals).' MB';
return trans_choice('statamic::messages.units.MB', number_format($bytes / 1048576, $decimals));
} elseif ($bytes >= 1024) {
$bytes = number_format($bytes / 1024, $decimals).' KB';
} elseif ($bytes > 1) {
$bytes = $bytes.' B';
} elseif ($bytes == 1) {
$bytes = $bytes.' B';
} else {
$bytes = '0 B';
return trans_choice('statamic::messages.units.KB', number_format($bytes / 1024, $decimals));
}

return $bytes;
return trans_choice('statamic::messages.units.B', $bytes);
}

public static function timeForHumans($ms)
{
if ($ms < 1000) {
return $ms.'ms';
return trans_choice('statamic::messages.units.ms', $ms);
}

return round($ms / 1000, 2).'s';
return trans_choice('statamic::messages.units.s', round($ms / 1000, 2));
}

/**
Expand Down
Loading