Skip to content

Adding more translation strings for server panel (non-admin) #1418

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

Draft
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

JamesMCL44
Copy link

No description provided.

Copy link
Contributor

github-actions bot commented May 31, 2025

All contributors have signed the CLA ✍️ ✅
Posted by the CLA Assistant Lite bot.

@SirEndii
Copy link

SirEndii commented May 31, 2025

Translation is all done on Crowdin. Please submit your translations here

@JamesMCL44
Copy link
Author

noted, but this pr is to add more translation strings related to the panel by server user, i.e., the console, file browser etc.
Please kindly check my coding before comment/reply, thanks.

@SirEndii
Copy link

Haha, sorry. I just saw the title and assumed there were translations, like with the other dozens of PRs

@JamesMCL44
Copy link
Author

I have read the CLA Document and I hereby sign the CLA

@JamesMCL44 JamesMCL44 changed the title Translation Adding more translation strings for server panel (non-admin) May 31, 2025
Copy link
Member

@lancepioch lancepioch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please take out the Chinese translations, we use crowdin for translations

@JamesMCL44 JamesMCL44 requested a review from lancepioch June 3, 2025 12:01
Copy link
Member

@lancepioch lancepioch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a bunch, just need to fix up these final keys and I think we're ready to go!

@@ -32,6 +32,6 @@ public function getColor(): string

public function getLabel(): string
{
return str($this->value)->headline();
return trans('strings.backupstatus.'.str($this->value));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Spaces should be replaced with underscores! BackupStatus = backup_status or Backup Status for example.

Suggested change
return trans('strings.backupstatus.'.str($this->value));
return trans('strings.backup_status.'.str($this->value));

@@ -68,7 +68,7 @@ public function getColor(bool $hex = false): string

public function getLabel(): string
{
return str($this->value)->title();
return trans('strings.containerstatus.'.str($this->value));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
return trans('strings.containerstatus.'.str($this->value));
return trans('strings.container_status.'.str($this->value));

@@ -152,20 +152,23 @@ protected function getHeaderActions(): array

return [
Action::make('start')
->label(trans('strings.consolestatus.start'))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
->label(trans('strings.consolestatus.start'))
->label(trans('strings.console_status.start'))

->color('primary')
->size(ActionSize::ExtraLarge)
->dispatch('setServerState', ['state' => 'start', 'uuid' => $server->uuid])
->authorize(fn () => auth()->user()->can(Permission::ACTION_CONTROL_START, $server))
->disabled(fn () => $server->isInConflictState() || !$this->status->isStartable())
->icon('tabler-player-play-filled'),
Action::make('restart')
->label(trans('strings.consolestatus.restart'))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
->label(trans('strings.consolestatus.restart'))
->label(trans('strings.console_status.restart'))

->color('gray')
->size(ActionSize::ExtraLarge)
->dispatch('setServerState', ['state' => 'restart', 'uuid' => $server->uuid])
->authorize(fn () => auth()->user()->can(Permission::ACTION_CONTROL_RESTART, $server))
->disabled(fn () => $server->isInConflictState() || !$this->status->isRestartable())
->icon('tabler-reload'),
Action::make('stop')
->label(trans('strings.consolestatus.stop'))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
->label(trans('strings.consolestatus.stop'))
->label(trans('strings.console_status.stop'))

'unarchive' => 'Unarchive',
'unarchive_completed' => 'Unarchive completed',
'deletefileconfirm' => 'Delete file?',
'bulkmove' => [
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
'bulkmove' => [
'bulk_move' => [

'archive_created' => 'Archive created',
'unarchive' => 'Unarchive',
'unarchive_completed' => 'Unarchive completed',
'deletefileconfirm' => 'Delete file?',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
'deletefileconfirm' => 'Delete file?',
'delete_file_confirm' => 'Delete file?',

'is_directory' => [
'title' => '<code> :file is a directory',
],
'ignorefile' => [
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
'ignorefile' => [
'ignore_file' => [

return [
'edit' => [
'editing_title' => 'Editing :path',
'save&close' => 'Save & Close',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
'save&close' => 'Save & Close',
'save_and_close' => 'Save & Close',

Comment on lines +8 to +11
'assignall' => 'Assign All',
'heading' => 'Invite User',
'actionlabel' => 'Invite',
'userinvited' => 'User Invited!',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
'assignall' => 'Assign All',
'heading' => 'Invite User',
'actionlabel' => 'Invite',
'userinvited' => 'User Invited!',
'assign_all' => 'Assign All',
'heading' => 'Invite User',
'action_label' => 'Invite',
'user_invited' => 'User Invited!',

@lancepioch lancepioch self-assigned this Jun 7, 2025
@JamesMCL44
Copy link
Author

JamesMCL44 commented Jun 7, 2025

Thanks for your comments and guides.
the pr is my first attempt to help out and therefore many are not in well structure
I now understand the structure of files and strings you wish to use.
Meanwhile, i do also notice some more texts could be converted to be translatable, I will work on those, fixing those you commented and also will try to minimise the Strings file so that users can locate the strings much easily.

I will work on it and finishing hopefully this Jun, please hold the merge for now.

@rmartinoscar rmartinoscar marked this pull request as draft June 8, 2025 16:20
@@ -32,6 +32,6 @@ public function getColor(): string

public function getLabel(): string
{
return str($this->value)->headline();
return trans('strings.backupstatus.'.str($this->value));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
return trans('strings.backupstatus.'.str($this->value));
return trans('strings.backupstatus.' . $this->value);

No need for str when not using headline since this Enum is a string

enum BackupStatus: string implements HasColor, HasIcon, HasLabel

@@ -68,7 +68,7 @@ public function getColor(bool $hex = false): string

public function getLabel(): string
{
return str($this->value)->title();
return trans('strings.containerstatus.'.str($this->value));
Copy link
Contributor

@rmartinoscar rmartinoscar Jun 8, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
return trans('strings.containerstatus.'.str($this->value));
return trans('strings.containerstatus.' . $this->value);

No need for str when not using headline since this Enum is a string

enum BackupStatus: string implements HasColor, HasIcon, HasLabel

@rmartinoscar rmartinoscar linked an issue Jun 11, 2025 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add localization to client area (& server list)
4 participants