Skip to content

Commit

Permalink
fix add lang
Browse files Browse the repository at this point in the history
  • Loading branch information
xxl4 committed Jun 25, 2024
1 parent 3beb8ff commit 941f21d
Show file tree
Hide file tree
Showing 66 changed files with 9,243 additions and 202 deletions.
10 changes: 5 additions & 5 deletions src/Http/Controllers/Api/V1/Admin/CMS/PageController.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public function store(Request $request)

return response([
'data' => new PageResource($page),
'message' => trans('rest-api::app.admin.cms.create-success'),
'message' => trans('Apis::app.admin.cms.create-success'),
]);
}

Expand All @@ -73,7 +73,7 @@ public function update(Request $request, int $id)
$request->validate([
$locale.'.url_key' => ['required', new Slug, function ($attribute, $value, $fail) use ($id) {
if (! $this->getRepositoryInstance()->isUrlKeyUnique($id, $value)) {
$fail(trans('rest-api::app.admin.cms.error.already-taken'));
$fail(trans('Apis::app.admin.cms.error.already-taken'));
}
}],
$locale.'.page_title' => 'required',
Expand All @@ -93,7 +93,7 @@ public function update(Request $request, int $id)

return response([
'data' => new PageResource($page),
'message' => trans('rest-api::app.admin.cms.update-success'),
'message' => trans('Apis::app.admin.cms.update-success'),
]);
}

Expand All @@ -111,7 +111,7 @@ public function destroy(int $id)
Event::dispatch('cms.pages.delete.after', $id);

return response([
'message' => trans('rest-api::app.admin.cms.mass-operations.delete-success'),
'message' => trans('Apis::app.admin.cms.mass-operations.delete-success'),
]);
}

Expand All @@ -133,7 +133,7 @@ public function massDestroy(MassDestroyRequest $massDestroyRequest)
}

return response([
'message' => trans('rest-api::app.admin.cms.mass-operations.delete-success'),
'message' => trans('Apis::app.admin.cms.mass-operations.delete-success'),
]);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ public function store()

return response([
'data' => new AttributeResource($attribute),
'message' => trans('rest-api::app.admin.catalog.attributes.create-success'),
'message' => trans('Apis::app.admin.catalog.attributes.create-success'),
]);
}

Expand Down Expand Up @@ -106,7 +106,7 @@ public function update(int $id)

if ($attribute->type != request()->input('type')) {
return response([
'message' => trans('rest-api::app.admin.catalog.attributes.error.cannot-change-type'),
'message' => trans('Apis::app.admin.catalog.attributes.error.cannot-change-type'),
], 400);
}

Expand All @@ -122,7 +122,7 @@ public function update(int $id)

return response([
'data' => new AttributeResource($attribute),
'message' => trans('rest-api::app.admin.catalog.attributes.update-success'),
'message' => trans('Apis::app.admin.catalog.attributes.update-success'),
]);
}

Expand All @@ -137,7 +137,7 @@ public function destroy(int $id)

if (! $attribute->is_user_defined) {
return response([
'message' => trans('rest-api::app.admin.catalog.attributes.error.system-attributes.delete'),
'message' => trans('Apis::app.admin.catalog.attributes.error.system-attributes.delete'),
], 400);
}

Expand All @@ -148,7 +148,7 @@ public function destroy(int $id)
Event::dispatch('catalog.attribute.delete.after', $id);

return response([
'message' => trans('rest-api::app.admin.catalog.attributes.delete-success'),
'message' => trans('Apis::app.admin.catalog.attributes.delete-success'),
]);
}

Expand All @@ -166,7 +166,7 @@ public function massDestroy(MassDestroyRequest $request)

if (! $attribute->is_user_defined) {
return response([
'message' => trans('rest-api::app.admin.catalog.attributes.error.system-attributes-delete'),
'message' => trans('Apis::app.admin.catalog.attributes.error.system-attributes-delete'),
], 400);
}
}
Expand All @@ -180,7 +180,7 @@ public function massDestroy(MassDestroyRequest $request)
}

return response([
'message' => trans('rest-api::app.admin.catalog.attributes.delete-success'),
'message' => trans('Apis::app.admin.catalog.attributes.delete-success'),
]);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public function store()

return response([
'data' => new AttributeFamilyResource($attributeFamily),
'message' => trans('rest-api::app.admin.catalog.families.create-success'),
'message' => trans('Apis::app.admin.catalog.families.create-success'),
]);
}

Expand Down Expand Up @@ -83,7 +83,7 @@ public function update(int $id)

if ($attributeFamily->code != request()->input('code')) {
return response([
'message' => trans('rest-api::app.admin.catalog.families.error.can-not-updated'),
'message' => trans('Apis::app.admin.catalog.families.error.can-not-updated'),
], 400);
}

Expand All @@ -93,7 +93,7 @@ public function update(int $id)

return response([
'data' => new AttributeFamilyResource($attributeFamily),
'message' => trans('rest-api::app.admin.catalog.families.update-success'),
'message' => trans('Apis::app.admin.catalog.families.update-success'),
]);
}

Expand All @@ -108,13 +108,13 @@ public function destroy(int $id)

if ($this->getRepositoryInstance()->count() == 1) {
return response([
'message' => trans('rest-api::app.admin.catalog.families.error.last-item-delete'),
'message' => trans('Apis::app.admin.catalog.families.error.last-item-delete'),
], 400);
}

if ($attributeFamily->products()->count()) {
return response([
'message' => trans('rest-api::app.admin.catalog.families.error.being-used'),
'message' => trans('Apis::app.admin.catalog.families.error.being-used'),
], 400);
}

Expand All @@ -125,7 +125,7 @@ public function destroy(int $id)
Event::dispatch('catalog.attribute_family.delete.after', $id);

return response([
'message' => trans('rest-api::app.admin.catalog.families.delete-success'),
'message' => trans('Apis::app.admin.catalog.families.delete-success'),
]);
}
}
14 changes: 7 additions & 7 deletions src/Http/Controllers/Api/V1/Admin/Catalog/CategoryController.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public function store(CategoryRequest $request)

return response([
'data' => new CategoryResource($category),
'message' => trans('rest-api::app.admin.catalog.categories.create-success'),
'message' => trans('Apis::app.admin.catalog.categories.create-success'),
]);
}

Expand Down Expand Up @@ -93,7 +93,7 @@ public function update(CategoryRequest $request, int $id)

return response([
'data' => new CategoryResource($category),
'message' => trans('rest-api::app.admin.catalog.categories.update-success'),
'message' => trans('Apis::app.admin.catalog.categories.update-success'),
]);
}

Expand All @@ -108,7 +108,7 @@ public function destroy(int $id)

if (! $this->isCategoryDeletable($category)) {
return response([
'message' => trans('rest-api::app.admin.catalog.categories.root-category-delete'),
'message' => trans('Apis::app.admin.catalog.categories.root-category-delete'),
], 400);
}

Expand All @@ -119,7 +119,7 @@ public function destroy(int $id)
Event::dispatch('catalog.category.delete.after', $id);

return response([
'message' => trans('rest-api::app.admin.catalog.categories.delete-success'),
'message' => trans('Apis::app.admin.catalog.categories.delete-success'),
]);
}

Expand Down Expand Up @@ -147,7 +147,7 @@ public function massUpdate(MassUpdateRequest $massUpdateRequest)
}

return response([
'message' => trans('rest-api::app.admin.catalog.categories.mass-operations.update-success'),
'message' => trans('Apis::app.admin.catalog.categories.mass-operations.update-success'),
]);
}

Expand All @@ -162,7 +162,7 @@ public function massDestroy(MassDestroyRequest $massDestroyRequest)

if ($this->containsNonDeletableCategory($categories)) {
return response([
'message' => trans('rest-api::app.admin.catalog.categories.error.root-category-delete'),
'message' => trans('Apis::app.admin.catalog.categories.error.root-category-delete'),
], 400);
}

Expand All @@ -175,7 +175,7 @@ public function massDestroy(MassDestroyRequest $massDestroyRequest)
});

return response([
'message' => trans('rest-api::app.admin.catalog.categories.mass-operations.delete-success'),
'message' => trans('Apis::app.admin.catalog.categories.mass-operations.delete-success'),
]);
}

Expand Down
14 changes: 7 additions & 7 deletions src/Http/Controllers/Api/V1/Admin/Catalog/ProductController.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public function store(Request $request)
|| ! count($request->get('super_attributes')))
) {
return response([
'message' => trans('rest-api::app.admin.catalog.products.error.configurable-error'),
'message' => trans('Apis::app.admin.catalog.products.error.configurable-error'),
], 400);
}

Expand All @@ -63,7 +63,7 @@ public function store(Request $request)

return response([
'data' => new ProductResource($product),
'message' => trans('rest-api::app.admin.catalog.products.create-success'),
'message' => trans('Apis::app.admin.catalog.products.create-success'),
]);
}

Expand Down Expand Up @@ -107,7 +107,7 @@ public function update(ProductForm $request, int $id)

return response([
'data' => new ProductResource($product),
'message' => trans('rest-api::app.admin.catalog.products.update-success'),
'message' => trans('Apis::app.admin.catalog.products.update-success'),
]);
}

Expand All @@ -130,7 +130,7 @@ public function updateInventories(InventoryRequest $inventoryRequest, ProductInv
'data' => [
'total' => $productInventoryRepository->where('product_id', $product->id)->sum('qty'),
],
'message' => trans('rest-api::app.admin.catalog.products.inventories.update-success'),
'message' => trans('Apis::app.admin.catalog.products.inventories.update-success'),
]);
}

Expand All @@ -150,7 +150,7 @@ public function destroy(int $id)
Event::dispatch('catalog.product.delete.after', $id);

return response([
'message' => trans('rest-api::app.admin.catalog.products.delete-success'),
'message' => trans('Apis::app.admin.catalog.products.delete-success'),
]);
}

Expand All @@ -172,7 +172,7 @@ public function massDestroy(MassDestroyRequest $massDestroyRequest)
}

return response([
'message' => trans('rest-api::app.admin.catalog.products.mass-operations.delete-success'),
'message' => trans('Apis::app.admin.catalog.products.mass-operations.delete-success'),
]);
}

Expand All @@ -198,7 +198,7 @@ public function massUpdate(MassUpdateRequest $massUpdateRequest)
}

return response([
'message' => trans('rest-api::app.admin.catalog.products.mass-operations.update-success'),
'message' => trans('Apis::app.admin.catalog.products.mass-operations.update-success'),
]);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public function store(ConfigurationForm $request)

return response([
'data' => $coreConfigData,
'message' => trans('rest-api::app.admin.configuration.update-success'),
'message' => trans('Apis::app.admin.configuration.update-success'),
]);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ public function store(int $customerId)

return response([
'data' => new CustomerAddressResource($customerAddress),
'message' => trans('rest-api::app.admin.customers.addresses.create-success'),
'message' => trans('Apis::app.admin.customers.addresses.create-success'),
]);
}

Expand Down Expand Up @@ -184,7 +184,7 @@ public function update(int $customerId, int $id)

return response([
'data' => new CustomerAddressResource($customerAddress),
'message' => trans('rest-api::app.admin.customers.addresses.update-success'),
'message' => trans('Apis::app.admin.customers.addresses.update-success'),
]);
}

Expand All @@ -206,7 +206,7 @@ public function destroy(int $customerId, int $id)
Event::dispatch('customer.addresses.delete.after', $id);

return response([
'message' => trans('rest-api::app.admin.customers.addresses.delete-success'),
'message' => trans('Apis::app.admin.customers.addresses.delete-success'),
]);
}

Expand All @@ -226,7 +226,7 @@ public function massDestroy(MassDestroyRequest $massDestroyRequest, int $custome
}

return response([
'message' => trans('rest-api::app.admin.customers.addresses.mass-operations.delete-success'),
'message' => trans('Apis::app.admin.customers.addresses.mass-operations.delete-success'),
]);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ public function store(Request $request)

return response([
'data' => new CustomerResource($customer),
'message' => trans('rest-api::app.admin.customers.customers.create-success'),
'message' => trans('Apis::app.admin.customers.customers.create-success'),
]);
}

Expand Down Expand Up @@ -123,7 +123,7 @@ public function update(Request $request, int $id)

return response([
'data' => new CustomerResource($customer),
'message' => trans('rest-api::app.admin.customers.customers.update-success'),
'message' => trans('Apis::app.admin.customers.customers.update-success'),
]);
}

Expand All @@ -140,12 +140,12 @@ public function destroy(int $id)
$this->getRepositoryInstance()->delete($id);

return response([
'message' => trans('rest-api::app.admin.customers.customers.delete-success'),
'message' => trans('Apis::app.admin.customers.customers.delete-success'),
]);
}

return response([
'message' => trans('rest-api::app.admin.customers.customers.error.order-pending-account-delete'),
'message' => trans('Apis::app.admin.customers.customers.error.order-pending-account-delete'),
], 400);
}

Expand All @@ -169,7 +169,7 @@ public function massUpdate(MassUpdateRequest $massUpdateRequest)
}

return response([
'message' => trans('rest-api::app.admin.customers.customers.mass-operations.update-success'),
'message' => trans('Apis::app.admin.customers.customers.mass-operations.update-success'),
]);
}

Expand All @@ -188,7 +188,7 @@ public function massDestroy(MassDestroyRequest $massDestroyRequest)
*/
foreach ($customers as $customer) {
if ($this->getRepositoryInstance()->haveActiveOrders($customer)) {
throw new \Exception(trans('rest-api::app.admin.customers.customers.error.order-pending-account-delete'));
throw new \Exception(trans('Apis::app.admin.customers.customers.error.order-pending-account-delete'));
}
}

Expand All @@ -204,7 +204,7 @@ public function massDestroy(MassDestroyRequest $massDestroyRequest)
}

return response([
'message' => trans('rest-api::app.admin.customers.customers.mass-operations.delete-success'),
'message' => trans('Apis::app.admin.customers.customers.mass-operations.delete-success'),
]);
} catch (\Exception $exception) {
return response([
Expand Down Expand Up @@ -268,7 +268,7 @@ public function storeNote(Request $request, int $id)

return response([
'data' => new CustomerResource($customer),
'message' => trans('rest-api::app.admin.customers.customers.notes.note-taken'),
'message' => trans('Apis::app.admin.customers.customers.notes.note-taken'),
]);
}
}
Loading

0 comments on commit 941f21d

Please sign in to comment.