Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .github/copilot-instructions.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,3 +49,9 @@ When dealing with monetary values in PHP, it's crucial to handle them with preci
we use the `moneyphp/money` library, which provides a robust way to manage monetary values and currencies.

Never use floats or doubles to represent monetary values. Instead, use integers to represent the smallest currency unit (e.g., cents for USD). This means that $10.99 should be stored as 1099 (cents).

# Translations

Translations files are located in the `resources/lang/` directory. Use snake_case for keys and group related translations in nested arrays.
Ignore all the the `lang/*.json` files as they are auto generated
and not tracked in git.
2 changes: 2 additions & 0 deletions lang/ar/renamer.php
Original file line number Diff line number Diff line change
Expand Up @@ -104,4 +104,6 @@
'test_original' => 'Original',
'test_result' => 'Result',
'test_failed' => 'Failed to test renamer rules',
'apply_photo_rules' => 'Apply photo rules',
'apply_album_rules' => 'Apply album rules',
];
2 changes: 2 additions & 0 deletions lang/cz/renamer.php
Original file line number Diff line number Diff line change
Expand Up @@ -104,4 +104,6 @@
'test_original' => 'Original',
'test_result' => 'Result',
'test_failed' => 'Failed to test renamer rules',
'apply_photo_rules' => 'Apply photo rules',
'apply_album_rules' => 'Apply album rules',
];
2 changes: 2 additions & 0 deletions lang/de/renamer.php
Original file line number Diff line number Diff line change
Expand Up @@ -104,4 +104,6 @@
'test_original' => 'Original',
'test_result' => 'Result',
'test_failed' => 'Failed to test renamer rules',
'apply_photo_rules' => 'Apply photo rules',
'apply_album_rules' => 'Apply album rules',
];
2 changes: 2 additions & 0 deletions lang/el/renamer.php
Original file line number Diff line number Diff line change
Expand Up @@ -104,4 +104,6 @@
'test_original' => 'Original',
'test_result' => 'Result',
'test_failed' => 'Failed to test renamer rules',
'apply_photo_rules' => 'Apply photo rules',
'apply_album_rules' => 'Apply album rules',
];
2 changes: 2 additions & 0 deletions lang/en/renamer.php
Original file line number Diff line number Diff line change
Expand Up @@ -104,4 +104,6 @@
'test_original' => 'Original',
'test_result' => 'Result',
'test_failed' => 'Failed to test renamer rules',
'apply_photo_rules' => 'Apply photo rules',
'apply_album_rules' => 'Apply album rules',
];
2 changes: 2 additions & 0 deletions lang/es/renamer.php
Original file line number Diff line number Diff line change
Expand Up @@ -104,4 +104,6 @@
'test_original' => 'Original',
'test_result' => 'Result',
'test_failed' => 'Failed to test renamer rules',
'apply_photo_rules' => 'Apply photo rules',
'apply_album_rules' => 'Apply album rules',
];
2 changes: 2 additions & 0 deletions lang/fa/renamer.php
Original file line number Diff line number Diff line change
Expand Up @@ -104,4 +104,6 @@
'test_original' => 'اصلی',
'test_result' => 'نتیجه',
'test_failed' => 'آزمایش قوانین تغییر نام ناموفق بود',
'apply_photo_rules' => 'Apply photo rules',
'apply_album_rules' => 'Apply album rules',
];
2 changes: 2 additions & 0 deletions lang/fr/renamer.php
Original file line number Diff line number Diff line change
Expand Up @@ -104,4 +104,6 @@
'test_original' => 'Original',
'test_result' => 'Result',
'test_failed' => 'Failed to test renamer rules',
'apply_photo_rules' => 'Apply photo rules',
'apply_album_rules' => 'Apply album rules',
];
2 changes: 2 additions & 0 deletions lang/hu/renamer.php
Original file line number Diff line number Diff line change
Expand Up @@ -104,4 +104,6 @@
'test_original' => 'Original',
'test_result' => 'Result',
'test_failed' => 'Failed to test renamer rules',
'apply_photo_rules' => 'Apply photo rules',
'apply_album_rules' => 'Apply album rules',
];
2 changes: 2 additions & 0 deletions lang/it/renamer.php
Original file line number Diff line number Diff line change
Expand Up @@ -104,4 +104,6 @@
'test_original' => 'Original',
'test_result' => 'Result',
'test_failed' => 'Failed to test renamer rules',
'apply_photo_rules' => 'Apply photo rules',
'apply_album_rules' => 'Apply album rules',
];
2 changes: 2 additions & 0 deletions lang/ja/renamer.php
Original file line number Diff line number Diff line change
Expand Up @@ -104,4 +104,6 @@
'test_original' => 'Original',
'test_result' => 'Result',
'test_failed' => 'Failed to test renamer rules',
'apply_photo_rules' => 'Apply photo rules',
'apply_album_rules' => 'Apply album rules',
];
2 changes: 2 additions & 0 deletions lang/nl/renamer.php
Original file line number Diff line number Diff line change
Expand Up @@ -104,4 +104,6 @@
'test_original' => 'Original',
'test_result' => 'Result',
'test_failed' => 'Failed to test renamer rules',
'apply_photo_rules' => 'Apply photo rules',
'apply_album_rules' => 'Apply album rules',
];
2 changes: 2 additions & 0 deletions lang/no/renamer.php
Original file line number Diff line number Diff line change
Expand Up @@ -104,4 +104,6 @@
'test_original' => 'Original',
'test_result' => 'Result',
'test_failed' => 'Failed to test renamer rules',
'apply_photo_rules' => 'Apply photo rules',
'apply_album_rules' => 'Apply album rules',
];
2 changes: 2 additions & 0 deletions lang/pl/renamer.php
Original file line number Diff line number Diff line change
Expand Up @@ -104,4 +104,6 @@
'test_original' => 'Original',
'test_result' => 'Result',
'test_failed' => 'Failed to test renamer rules',
'apply_photo_rules' => 'Apply photo rules',
'apply_album_rules' => 'Apply album rules',
];
2 changes: 2 additions & 0 deletions lang/pt/renamer.php
Original file line number Diff line number Diff line change
Expand Up @@ -104,4 +104,6 @@
'test_original' => 'Original',
'test_result' => 'Result',
'test_failed' => 'Failed to test renamer rules',
'apply_photo_rules' => 'Apply photo rules',
'apply_album_rules' => 'Apply album rules',
];
2 changes: 2 additions & 0 deletions lang/ru/renamer.php
Original file line number Diff line number Diff line change
Expand Up @@ -104,4 +104,6 @@
'test_original' => 'Original',
'test_result' => 'Result',
'test_failed' => 'Failed to test renamer rules',
'apply_photo_rules' => 'Apply photo rules',
'apply_album_rules' => 'Apply album rules',
];
2 changes: 2 additions & 0 deletions lang/sk/renamer.php
Original file line number Diff line number Diff line change
Expand Up @@ -104,4 +104,6 @@
'test_original' => 'Original',
'test_result' => 'Result',
'test_failed' => 'Failed to test renamer rules',
'apply_photo_rules' => 'Apply photo rules',
'apply_album_rules' => 'Apply album rules',
];
2 changes: 2 additions & 0 deletions lang/sv/renamer.php
Original file line number Diff line number Diff line change
Expand Up @@ -104,4 +104,6 @@
'test_original' => 'Original',
'test_result' => 'Result',
'test_failed' => 'Failed to test renamer rules',
'apply_photo_rules' => 'Apply photo rules',
'apply_album_rules' => 'Apply album rules',
];
2 changes: 2 additions & 0 deletions lang/vi/renamer.php
Original file line number Diff line number Diff line change
Expand Up @@ -104,4 +104,6 @@
'test_original' => 'Original',
'test_result' => 'Result',
'test_failed' => 'Failed to test renamer rules',
'apply_photo_rules' => 'Apply photo rules',
'apply_album_rules' => 'Apply album rules',
];
2 changes: 2 additions & 0 deletions lang/zh_CN/renamer.php
Original file line number Diff line number Diff line change
Expand Up @@ -104,4 +104,6 @@
'test_original' => 'Original',
'test_result' => 'Result',
'test_failed' => 'Failed to test renamer rules',
'apply_photo_rules' => 'Apply photo rules',
'apply_album_rules' => 'Apply album rules',
];
2 changes: 2 additions & 0 deletions resources/js/services/renamer-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ export type UpdateRenamerRuleRequest = CreateRenamerRuleRequest & {

export type TestRenamerRequest = {
candidate: string;
is_photo: boolean;
is_album: boolean;
};

export type TestRenamerResponse = {
Expand Down
15 changes: 14 additions & 1 deletion resources/js/views/RenamerRules.vue
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,16 @@
{{ $t("renamer.test_input_placeholder") }}
</label>
</FloatLabel>
<div class="grid grid-cols-2">
<div class="flex gap-2 items-center">
<ToggleSwitch v-model="is_photo" input-id="is_photo_toggle_test" />
<label class="text-muted-color-emphasis" for="is_photo_toggle_test">{{ $t("renamer.apply_photo_rules") }}</label>
</div>
<div class="flex gap-2 items-center">
<ToggleSwitch v-model="is_album" input-id="is_album_toggle_test" />
<label class="text-muted-color-emphasis" for="is_album_toggle_test">{{ $t("renamer.apply_album_rules") }}</label>
</div>
</div>
<ProgressBar v-if="isTestLoading" mode="indeterminate" class="w-full" />
<div v-if="testResult !== null" class="grid grid-cols-1 md:grid-cols-2 gap-4">
<div>
Expand Down Expand Up @@ -121,6 +131,7 @@ import InputText from "@/components/forms/basic/InputText.vue";
import Card from "primevue/card";
import FloatLabel from "primevue/floatlabel";
import ProgressBar from "primevue/progressbar";
import ToggleSwitch from "primevue/toggleswitch";

const rules = ref<App.Http.Resources.Models.RenamerRuleResource[] | undefined>(undefined);
const showCreateModal = ref(false);
Expand All @@ -130,6 +141,8 @@ const selectedRule = ref<App.Http.Resources.Models.RenamerRuleResource | undefin
const testInput = ref("");
const testResult = ref<TestRenamerResponse | null>(null);
const isTestLoading = ref(false);
const is_photo = ref(true);
const is_album = ref(true);
const testError = ref<string | null>(null);
let testTimeout: NodeJS.Timeout | null = null;

Expand Down Expand Up @@ -160,7 +173,7 @@ function performTest() {
isTestLoading.value = true;
testError.value = null;

RenamerService.test({ candidate: testInput.value })
RenamerService.test({ candidate: testInput.value, is_photo: is_photo.value, is_album: is_album.value })
.then((response) => {
testResult.value = response.data;
})
Expand Down
Loading