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

feat(ar-SA): add ar-SA locale #480

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all 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
1 change: 1 addition & 0 deletions .github/workflows/ai-translate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ name: AI translate
description: Locale to auto translate
options:
- ALL
- ar-SA
- be-BY
- cs-CZ
- da-DK
Expand Down
63 changes: 32 additions & 31 deletions README.md

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions apps/studio/locales.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// This file is auto-generated by scripts/studioLocales.ts
import {arSALocale} from '@sanity/locale-ar-sa'
import {beBYLocale} from '@sanity/locale-be-by'
import {csCZLocale} from '@sanity/locale-cs-cz'
import {daDKLocale} from '@sanity/locale-da-dk'
Expand Down Expand Up @@ -30,6 +31,7 @@ import {zhHansLocale} from '@sanity/locale-zh-hans'
import {zhHantLocale} from '@sanity/locale-zh-hant'

export const locales = [
arSALocale(),
beBYLocale(),
csCZLocale(),
daDKLocale(),
Expand Down
1 change: 1 addition & 0 deletions apps/studio/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
},
"dependencies": {
"@sanity/icons": "^2.10.3",
"@sanity/locale-ar-sa": "workspace:*",
"@sanity/locale-be-by": "workspace:*",
"@sanity/locale-cs-cz": "workspace:*",
"@sanity/locale-da-dk": "workspace:*",
Expand Down
1 change: 1 addition & 0 deletions apps/studio/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"compilerOptions": {
"paths": {
"@sanity/locale-ar-sa": ["../../locales/ar-SA/src"],
"@sanity/locale-be-by": ["../../locales/be-BY/src"],
"@sanity/locale-cs-cz": ["../../locales/cs-CZ/src"],
"@sanity/locale-da-dk": ["../../locales/da-DK/src"],
Expand Down
21 changes: 21 additions & 0 deletions locales/ar-SA/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2024 Sanity.io

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
57 changes: 57 additions & 0 deletions locales/ar-SA/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
# @sanity/locale-ar-sa

Arabic (Saudi Arabia) / العربية (السعودية) language support for [Sanity Studio](https://www.sanity.io/).

## Description

This is a community maintained language plugin. Initial translations were done by AI and may have errors. Contributions are [more than welcome](#contributing)!

## Installation

```sh
npm install @sanity/locale-ar-sa
```

## Usage

```ts
// sanity.config.ts / sanity.config.js:
import {defineConfig} from 'sanity'
import {arSALocale} from '@sanity/locale-ar-sa'

export default defineConfig({
// ...
plugins: [
// ... other plugins here ...
arSALocale(),
],
})
```

The language should now show up in the Studio's user menu.

If you want to customize the title of the locale, pass it as an option to the plugin:

```ts
// sanity.config.ts / sanity.config.js:
import {defineConfig} from 'sanity'
import {arSALocale} from '@sanity/locale-ar-sa'

export default defineConfig({
// ...
plugins: [
// ... other plugins here ...
arSALocale({
title: 'Arabic (Saudi Arabia)',
}),
],
})
```

## Contributing

Feel free to contribute improvements/changes! The strings are located in the `src` folder, where the file name represents the "namespace". Send a pull request, and feel free to add yourself to the `contributors` array in `locales/registry.ts`. If you want to help review new translations, add yourself to the `maintainers` array instead. After doing your changes, run `pnpm run reconcile` and add the changes to version control.

## License

MIT-licensed. See LICENSE.
6 changes: 6 additions & 0 deletions locales/ar-SA/package.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import {defineConfig} from '@sanity/pkg-utils'

export default defineConfig({
tsconfig: '../../tsconfig.locale.json',
minify: false,
})
63 changes: 63 additions & 0 deletions locales/ar-SA/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
{
"name": "@sanity/locale-ar-sa",
"version": "1.0.0",
"private": false,
"description": "Arabic (Saudi Arabia) / العربية (السعودية) locale/translation for Sanity Studio",
"keywords": [
"sanity",
"i18n",
"locale",
"localization",
"ar-SA"
],
"homepage": "https://github.com/sanity-io/locales#readme",
"bugs": {
"url": "https://github.com/sanity-io/locales/issues"
},
"repository": {
"type": "git",
"url": "git+ssh://git@github.com/sanity-io/locales.git",
"directory": "locales/ar-SA"
},
"license": "MIT",
"contributors": [
{
"name": "f22hd",
"url": "https://github.com/f22hd"
}
],
"sideEffects": false,
"type": "module",
"exports": {
".": {
"types": "./dist/index.d.ts",
"source": "./src/index.ts",
"import": "./dist/index.js",
"require": "./dist/index.cjs",
"default": "./dist/index.js"
},
"./package.json": "./package.json"
},
"main": "./dist/index.cjs",
"module": "./dist/index.js",
"source": "./src/index.ts",
"types": "./dist/index.d.ts",
"files": [
"dist",
"src"
],
"scripts": {
"build": "npm run clean && npm run pkg:build && npm run pkg:check",
"clean": "rimraf dist",
"pkg:build": "pkg build --strict",
"pkg:check": "pkg check --strict",
"prepublishOnly": "pnpm build"
},
"browserslist": "extends @sanity/browserslist-config",
"peerDependencies": {
"sanity": "^3.22.0"
},
"publishConfig": {
"access": "public"
}
}
193 changes: 193 additions & 0 deletions locales/ar-SA/src/comments.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,193 @@
import {removeUndefinedLocaleResources} from 'sanity'

export default removeUndefinedLocaleResources({
/** The close comments button text */
'close-pane-button-text': 'إغلاق التعليقات',

/** The aria label for the close comments button */
'close-pane-button-text-aria-label': 'إغلاق التعليقات',

/** When composing a comment, the placeholder text shown when adding a comment to a field with no current comments */
'compose.add-comment-input-placeholder': 'أضف تعليقًا إلى <strong>{{field}}</strong>',
/** When composing a comment, the placeholder text shown when adding a comment to a field with no current comments and the mode is upsell */
'compose.add-comment-input-placeholder-upsell': 'ترقية لإضافة تعليق',
/** When composing a comment, the placeholder text shown when the input is empty */
'compose.create-comment-placeholder': 'إنشاء تعليق جديد',
/** When composing a comment, the aria label for the button to mention a user */
'compose.mention-user-aria-label': 'ذكر المستخدم',
/** When composing a comment, the tooltip text for the button to mention a user */
'compose.mention-user-tooltip': 'ذكر المستخدم',
/** When composing a reply, the placeholder text shown when the input is empty */
'compose.reply-placeholder': 'رد',
/** When composing a reply, the placeholder text shown when the input is empty and the mode is upsell */
'compose.reply-placeholder-upsell': 'ترقية للرد',
/** When composing a comment, the aria label for the button to send a comment */
'compose.send-comment-aria-label': 'إرسال التعليق',
/** When composing a comment, the tooltip text for the button to send a comment */
'compose.send-comment-tooltip': 'إرسال التعليق',

/** The inspector text when error copying link */
'copy-link-error-message': 'تعذر نسخ الرابط إلى الحافظة',

/** The inspector successfully copied link text */
'copy-link-success-message': 'تم نسخ الرابط إلى الحافظة',

/** The delete dialog body for a comment */
'delete-comment.body': 'بمجرد الحذف، لا يمكن استرداد التعليق.',
/** The delete dialog confirm button text for a comment */
'delete-comment.confirm': 'حذف التعليق',
/** The delete dialog title for a comment */
'delete-comment.title': 'حذف هذا التعليق؟',

/** The delete dialog error */
'delete-dialog.error': 'حدث خطأ أثناء حذف التعليق. الرجاء المحاولة مرة أخرى.',

/** The delete dialog body for a thread */
'delete-thread.body': 'سيتم حذف هذا التعليق وردوده، وبمجرد الحذف لا يمكن استردادها.',
/** The delete dialog conform button text for a thread */
'delete-thread.confirm': 'حذف الموضوع',
/** The delete dialog title for a thread */
'delete-thread.title': 'حذف موضوع التعليق هذا؟',

/** The button text for confirming discard */
'discard.button-confirm': 'تجاهل',
/** The header for discard comment dialog */
'discard.header': 'تجاهل التعليق؟',
/** The text for discard comment dialog */
'discard.text': 'هل تريد تجاهل التعليق؟',

/** Sharing feedback on the comments feature: The link title */
'feature-feedback.link': 'شارك بملاحظاتك',
/** Sharing feedback on the comments feature: The form title */
'feature-feedback.title': 'ساعد في التحسين ',

/** The name of the comments feature, for use in header. Capitalized, eg "Comments". */
'feature-name': 'التعليقات',

/** Aria label for button above fields to add a comment, when the field currently do not have any comments */
'field-button.aria-label-add': 'أضف تعليقًا',
/** Aria label for button above fields that opens the comments for this field, when there are existing comments */
'field-button.aria-label-open': 'افتح التعليقات',
/** Text shown in popover when hovering the button above fields that opens the comments panel, when there is a single comment present */
'field-button.content_one': 'عرض التعليق',
/** Text shown in popover when hovering the button above fields to add a comment, when the field currently do not have any comments */
'field-button.title': 'أضف تعليقًا',

/* The text shown in the inline comment button when the button is disabled due to overlap */
'inline-add-comment-button.disabled-overlap-title': 'لا يمكن أن تتداخل التعليقات',
/** The text shown in the inline comment button */
'inline-add-comment-button.title': 'أضف تعليقًا',

/** Aria label for the breadcrumb button showing the field path. `{{field}}` is the last (most specific) field. */
'list-item.breadcrumb-button-go-to-field-aria-label': 'اذهب إلى حقل {{field}}',
/** The button tooltip content for the add reaction button */
'list-item.context-menu-add-reaction': 'أضف رد فعل',
/** The button tooltip aria label for adding a reaction */
'list-item.context-menu-add-reaction-aria-label': 'أضف رد فعل',
/** The button tooltip content for the add reaction button and mode is upsell */
'list-item.context-menu-add-reaction-upsell': 'ترقية لإضافة رد فعل',
/** The action menu item for copying a comment link */
'list-item.copy-link': 'انسخ رابط التعليق',
/** The action menu item for deleting a comment */
'list-item.delete-comment': 'حذف التعليق',
/** The action menu item for editing a comment */
'list-item.edit-comment': 'تعديل التعليق',
/** The action menu item for editing a comment and the mode is upsell */
'list-item.edit-comment-upsell': 'ترقية لتعديل التعليق',
/** Aria label for the button that takes you to the field, which wraps a thread/comment */
'list-item.go-to-field-button.aria-label': 'اذهب إلى الحقل',
/**
* The text shown below the author and timestamp of a comment including a link back to the context in which the comment was made.
* Consists of a document title wrapped in a link, and a word or phrase to indicate that the link refers to a location:
* eg "on Home", "on Coffee Machine | Products", "on Pricing – Sanity"
*/
'list-item.layout-context': 'على <IntentLink>{{title}}</IntentLink>',
/** The marker to indicate that a comment has been edited in brackets */
'list-item.layout-edited': 'تم التعديل',
/** The error text when sending a comment has failed */
'list-item.layout-failed-sent': 'فشل في الإرسال.',
/** The loading message when posting a comment is in progress */
'list-item.layout-posting': 'جاري النشر...',
/** The text for retrying posting a comment */
'list-item.layout-retry': 'أعد المحاولة',
/** The text shown when the value a comment references has been deleted */
'list-item.missing-referenced-value-tooltip-content': 'تم حذف النص المعلق عليه',
/** The aria label for the comments menu button to open the actions menu */
'list-item.open-menu-aria-label': 'افتح قائمة إجراءات التعليق',
/** The button text to re-open a resolved comment */
'list-item.re-open-resolved': 'أعد فتح',
/** The button aria label to re-open a comment that is resolved */
'list-item.re-open-resolved-aria-label': 'أعد فتح',
/** The button aria label to mark a comment as resolved */
'list-item.resolved-tooltip-aria-label': 'وسم التعليق كمحلول',
/** The button text to mark a comment as resolved */
'list-item.resolved-tooltip-content': 'وسم كمحلول',

/** The empty state text for open comments */
'list-status.empty-state-open-text': 'سيتم عرض التعليقات المفتوحة على هذا المستند هنا.',
/** The empty state title for open comments */
'list-status.empty-state-open-title': 'لا يوجد تعليقات مفتوحة بعد',
/** The empty state text for resolved comments */
'list-status.empty-state-resolved-text': 'سيتم عرض التعليقات المحلولة على هذا المستند هنا.',
/** The empty state title for resolved comments */
'list-status.empty-state-resolved-title': 'لا يوجد تعليقات محلولة بعد',
/** The list status message for error */
'list-status.error': 'حدث خطأ ما',
/** The list status message for loading status */
'list-status.loading': 'جاري تحميل التعليقات',

/** Text shown when no users can be found to mention */
'mentions.no-users-found': 'لم يتم العثور على مستخدمين',
/** Label/badge shown for users that are not authorized to see the document, and thus cannot be mentioned */
'mentions.unauthorized-user': 'غير مصرح',
/** Aria label for the command list for users to mention */
'mentions.user-list-aria-label': 'قائمة المستخدمين للإشارة إليهم',

/** The comments onboarding popover text */
'onboarding.body': 'يمكنك إضافة تعليقات إلى أي حقل في مستند. ستظهر هنا، مجمعة حسب الحقل.',
/** The comments onboarding dismiss text */
'onboarding.dismiss': 'فهمت',
/** The comments onboarding popover header text */
'onboarding.header': 'حقول المستندات الآن تحتوي على تعليقات',

/** Tooltip for the button to add a reaction to a comment */
'reactions.add-reaction-tooltip': 'إضافة رد فعل',
/** Aria label for the individual reactions you can choose from when reacting to a comment */
'reactions.react-with-aria-label': 'رد مع {{reactionName}}',
/** When a users' name cannot be resolved, fall back to this name */
'reactions.user-list.unknown-user-fallback-name': 'مستخدم غير معروف',
/**
* When showing list of users who have reacted, replaces your own name with "you", eg
* "Donna, you, James, and Tyler reacted with 👍". A different key (`_leading` suffix)
* is used when you are the first to react, eg "You, Donna and Tyler reacted with 👍".
* Use `{{name}}` if you want to instead use the current users' actual name.
*/
'reactions.user-list.you': 'أنت',
/**
* When showing list of users who have reacted, replaces your own name with "You", eg
* "You, Donna, James, and Tyler reacted with 👍". A different key (`_leading` suffix)
* is used when you are not the first to react, eg "Donna, you, James and Tyler reacted with 👍".
* Use `{{name}}` if you want to instead use the current users' actual name.
*/
'reactions.user-list.you_leading': 'أنت',
/**
* The text shown for the tooltip that appears when hovering over the reaction count, eg
* "Donna, James, and Tyler Reacted with 👍". Three components are available for use:
* - `<UserList/>` - the list of names of users who have reacted, using the locales list format
* - `<Text>` - should be wrapped around the text describing the action ("reacted with")
* - `<ReactionName/>` - the name of the reaction emoji, eg ":heavy_plus_sign:"
*/
'reactions.users-reacted-with-reaction':
'<UserList/> <Text>قاموا بالرد مع</Text> <ReactionName/>',

/** Status filter: The short title describing filtering on open (non-resolved) comments */
'status-filter.status-open': 'مفتوح',
/** Status filter: The full text for describing filtering on open (non-resolved) comments */
'status-filter.status-open-full': 'التعليقات المفتوحة',
/** Status filter: The short title describing filtering on resolved comments */
'status-filter.status-resolved': 'محلول',
/** Status filter: The full text for describing filtering on resolved comments */
'status-filter.status-resolved-full': 'التعليقات المحلولة',
/** Status filter: The full text for describing filtering on resolved comments and is upsell mode */
'status-filter.status-resolved-full-upsell': 'ترقية لرؤية التعليقات المحلولة',
})
Loading