@adminforth/i18n 2.2.0 → 2.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/build.log CHANGED
@@ -20,5 +20,5 @@ custom/package.json
20
20
  custom/pnpm-lock.yaml
21
21
  custom/tsconfig.json
22
22
 
23
- sent 47,746 bytes received 305 bytes 96,102.00 bytes/sec
24
- total size is 46,578 speedup is 0.97
23
+ sent 47,968 bytes received 305 bytes 96,546.00 bytes/sec
24
+ total size is 46,800 speedup is 0.97
@@ -23,7 +23,7 @@
23
23
  <button class="flex items-center justify-center w-full">
24
24
  <IconLanguageOutline class="text-gray-500 dark:text-gray-400 w-5 h-5" />
25
25
  <div class="flex items-end justify-start gap-2 cursor-pointer">
26
- <p class="text-justify max-h-[18px] truncate max-w-[60vw] md:max-w-none">{{ t('Translate filtered') }}</p>
26
+ <p class="text-justify max-h-[18px] truncate max-w-[60vw] md:max-w-none">{{props.checkboxes.length === 0 ? t('Translate filtered') : t('Translate selected ({count})', { count: props.checkboxes.length })}}</p>
27
27
  <div class="flex items-center justify-center text-white bg-gradient-to-r h-[18px] from-purple-500 via-purple-600 to-purple-700 hover:bg-gradient-to-br focus:ring-4 focus:outline-none focus:ring-purple-300 dark:focus:ring-purple-800 font-medium rounded-md text-sm px-1 text-center">
28
28
  {{t('AI')}}
29
29
  </div>
@@ -133,7 +133,13 @@
133
133
 
134
134
  async function runTranslation() {
135
135
  isLoading.value = true;
136
- const listOfIds = await getListOfIds();
136
+
137
+ let listOfIds = [];
138
+ if (props.checkboxes.length === 0) {
139
+ listOfIds = await getListOfIds();
140
+ } else {
141
+ listOfIds = props.checkboxes;
142
+ }
137
143
  try {
138
144
  const res = await callAdminForthApi({
139
145
  path: `/plugin/${props.meta.pluginInstanceId}/translate-selected-to-languages`,
@@ -23,7 +23,7 @@
23
23
  <button class="flex items-center justify-center w-full">
24
24
  <IconLanguageOutline class="text-gray-500 dark:text-gray-400 w-5 h-5" />
25
25
  <div class="flex items-end justify-start gap-2 cursor-pointer">
26
- <p class="text-justify max-h-[18px] truncate max-w-[60vw] md:max-w-none">{{ t('Translate filtered') }}</p>
26
+ <p class="text-justify max-h-[18px] truncate max-w-[60vw] md:max-w-none">{{props.checkboxes.length === 0 ? t('Translate filtered') : t('Translate selected ({count})', { count: props.checkboxes.length })}}</p>
27
27
  <div class="flex items-center justify-center text-white bg-gradient-to-r h-[18px] from-purple-500 via-purple-600 to-purple-700 hover:bg-gradient-to-br focus:ring-4 focus:outline-none focus:ring-purple-300 dark:focus:ring-purple-800 font-medium rounded-md text-sm px-1 text-center">
28
28
  {{t('AI')}}
29
29
  </div>
@@ -133,7 +133,13 @@
133
133
 
134
134
  async function runTranslation() {
135
135
  isLoading.value = true;
136
- const listOfIds = await getListOfIds();
136
+
137
+ let listOfIds = [];
138
+ if (props.checkboxes.length === 0) {
139
+ listOfIds = await getListOfIds();
140
+ } else {
141
+ listOfIds = props.checkboxes;
142
+ }
137
143
  try {
138
144
  const res = await callAdminForthApi({
139
145
  path: `/plugin/${props.meta.pluginInstanceId}/translate-selected-to-languages`,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adminforth/i18n",
3
- "version": "2.2.0",
3
+ "version": "2.3.0",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "type": "module",