Skip to content

Add Persian Language #6237

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

Open
wants to merge 2 commits into
base: master
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
30 changes: 15 additions & 15 deletions apps/remix-dapp/src/components/SettingsUI/locale.tsx
Original file line number Diff line number Diff line change
@@ -1,32 +1,32 @@
import { useContext, useEffect } from 'react';
import { AppContext } from '../../contexts';
import { useContext, useEffect } from 'react'
import { AppContext } from '../../contexts'

const localeMap: Record<string, string> = {
zh: 'Chinese Simplified - 简体中文',
en: 'English - English',
fr: 'French - Français',
it: 'Italian - Italiano',
es: 'Spanish - Español',
};
ir: 'Persian - فارسی',
}

export function LocaleUI() {
const { appState, dispatch } = useContext(AppContext);
const { selectedLocaleCode } = appState.settings;
const localeCodeList = Object.keys(localeMap);
const { appState, dispatch } = useContext(AppContext)
const { selectedLocaleCode } = appState.settings
const localeCodeList = Object.keys(localeMap)

useEffect(() => {
const defaultLocaleCode =
localStorage.getItem('selectedLocaleCode') || 'en';
setLocaleCode(defaultLocaleCode);
}, []);
const defaultLocaleCode = localStorage.getItem('selectedLocaleCode') || 'en'
setLocaleCode(defaultLocaleCode)
}, [])

const setLocaleCode = (localeCode: string) => {
dispatch({
type: 'SET_SETTINGS',
payload: { selectedLocaleCode: localeCode },
});
localStorage.setItem('selectedLocaleCode', localeCode);
};
})
localStorage.setItem('selectedLocaleCode', localeCode)
}

return (
<div className="d-block">
Expand All @@ -38,7 +38,7 @@ export function LocaleUI() {
className="form-control overflow-hidden w-100 font-weight-normal custom-select pr-4"
value={selectedLocaleCode || localeCodeList[0]}
onChange={(e) => {
setLocaleCode(e.target.value);
setLocaleCode(e.target.value)
}}
>
{localeCodeList.map((localeCode) => (
Expand All @@ -49,5 +49,5 @@ export function LocaleUI() {
</select>
</div>
</div>
);
)
}
16 changes: 9 additions & 7 deletions apps/remix-ide/src/app/tabs/locale-module.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,15 @@ import { Plugin } from '@remixproject/engine'
import { EventEmitter } from 'events'
import { QueryParams } from '@remix-project/remix-lib'
import * as packageJson from '../../../../../package.json'
import {Registry} from '@remix-project/remix-lib'
import { Registry } from '@remix-project/remix-lib'
import enJson from './locales/en'
import zhJson from './locales/zh'
import esJson from './locales/es'
import frJson from './locales/fr'
import itJson from './locales/it'
import koJson from './locales/ko'
import ruJson from './locales/ru'
import irJson from './locales/ir'
const _paq = window._paq = window._paq || []

const locales = [
Expand All @@ -19,7 +20,8 @@ const locales = [
{ code: 'it', name: 'Italian', localeName: 'Italiano', messages: itJson },
{ code: 'ko', name: 'Korean', localeName: '한국인', messages: koJson },
{ code: 'ru', name: 'Russian', localeName: 'Русский', messages: ruJson },
{ code: 'es', name: 'Spanish', localeName: 'Español', messages: esJson }
{ code: 'es', name: 'Spanish', localeName: 'Español', messages: esJson },
{ code: 'ir', name: 'Persian', localeName: 'فارسی', messages: irJson }
]

const profile = {
Expand All @@ -31,7 +33,7 @@ const profile = {
}

export class LocaleModule extends Plugin {
constructor () {
constructor() {
super(profile)
this.events = new EventEmitter()
this._deps = {
Expand All @@ -56,28 +58,28 @@ export class LocaleModule extends Plugin {
}

/** Return the active locale */
currentLocale () {
currentLocale() {
return this.locales[this.active]
}

/** Returns all locales as an array */
getLocales () {
getLocales() {
return Object.keys(this.locales).map(key => this.locales[key])
}

/**
* Change the current locale
* @param {string} [localeCode] - The code of the locale
*/
switchLocale (localeCode) {
switchLocale(localeCode) {
localeCode = localeCode && localeCode.toLocaleLowerCase()
if (localeCode && !Object.keys(this.locales).includes(localeCode)) {
throw new Error(`Locale ${localeCode} doesn't exist`)
}
const next = localeCode || this.active // Name
if (next === this.active) return // --> exit out of this method
_paq.push(['trackEvent', 'localeModule', 'switchTo', next])

const nextLocale = this.locales[next] // Locale
if (!this.forced) this._deps.config.set('settings/locale', next)

Expand Down
26 changes: 26 additions & 0 deletions apps/remix-ide/src/app/tabs/locales/ir/circuit.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"circuit.compiler": "کامپایلر",
"circuit.autoCompile": "کامپایل خودکار",
"circuit.hideWarnings": "پنهان کردن هشدارها",
"circuit.advancedConfigurations": "تنظیمات پیشرفته",
"circuit.compilerConfiguration": "پیکربندی کامپایلر",
"circuit.prime": "اول",
"circuit.useConfigurationFile": "استفاده از فایل پیکربندی",
"circuit.compile": "کامپایل",
"circuit.noFileSelected": "هیچ فایلی انتخاب نشده است",
"circuit.generateR1cs": "تولید R1CS",
"circuit.computeWitness": "محاسبه شاهد",
"circuit.generateProof": "تولید اثبات",
"circuit.signalInput": "ورودی سیگنال",
"circuit.compute": "محاسبه",
"circuit.setupExports": "راه اندازی و خروجی ها",
"circuit.provingScheme": "طرح اثبات",
"circuit.ptau": "قدرت TAU (PTAU)",
"circuit.randomText": "مراسم: متن تصادفی",
"circuit.randomBeacon": "مراسم: چراغ تصادفی",
"circuit.exportVerifierContract": "خروجی قرارداد تأیید کننده",
"circuit.exportVerificationKey": "خروجی کلید تأیید",
"circuit.exportVerifierCalldata": "خروجی داده تماس تأیید کننده",
"circuit.exportWtnsJson": "خروجی شاهد به عنوان JSON",
"circuit.runSetup": "اجرای راه اندازی"
}
28 changes: 28 additions & 0 deletions apps/remix-ide/src/app/tabs/locales/ir/contractverification.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{
"contract-verification.verifyNavTitle": "تأیید",
"contract-verification.receiptsNavTitle": "رسیدها",
"contract-verification.lookupNavTitle": "جستجو",
"contract-verification.settingsNavTitle": "تنظیمات",
"contract-verification.contractAddressInput": "آدرس قرارداد",
"contract-verification.proxyContractAddressInput": "آدرس پروکسی",
"contract-verification.proxyInputLabel": "قرارداد مستقر شده پشت یک پروکسی است",
"contract-verification.panelDisplayName": "تأیید قرارداد",
"contract-verification.searchableChainDropdownLabel": "زنجیره",
"contract-verification.contractAddressError": "لطفاً یک آدرس قرارداد معتبر وارد کنید",
"contract-verification.chainError": "لطفاً زنجیره را انتخاب کنید.",
"contract-verification.proxyAddressError": "لطفاً یک آدرس قرارداد پروکسی معتبر ارائه دهید.",
"contract-verification.verifyButton": "تأیید",
"contract-verification.lookupButton": "جستجو",
"contract-verification.receipts.noContractsSubmitted": "هیچ قراردادی برای تأیید ارسال نشده است",
"contract-verification.receiptsDefaultLayout.description": "وضعیت تأیید قراردادهای ارسال شده برای تأیید را بررسی کنید",
"contract-verification.verifyDefaultLayout.description": "قراردادهای کامپایل شده را در سرویس های تأیید مختلف تأیید کنید",
"contract-verification.lookupDefaultLayout.description": "قراردادهای تأیید شده را جستجو کرده و آنها را در Remix بارگیری کنید",
"contract-verification.settingsDefaultLayout.description": "تنظیمات را برای هر سرویس تأیید و زنجیره سفارشی کنید",
"contract-verification.configInputPlaceholderText": "افزودن {label}",
"contract-verification.configInputSaveButton": "ذخیره",
"contract-verification.configInputCancelButton": "لغو",
"contract-verification.constructorArgumentsToggleRawInput": "آرگومان های سازنده کدگذاری شده با ABI خام را وارد کنید",
"contract-verification.constructorArgumentsRawAbiEncodingResult": "آرگومان های سازنده کدگذاری شده با ABI",
"contract-verification.contractDropdownLabel": "{label}",
"contract-verification.contractDropDownDefaultText": "قرارداد کامپایل شده مورد نیاز است"
}
26 changes: 26 additions & 0 deletions apps/remix-ide/src/app/tabs/locales/ir/debugger.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"debugger.displayName": "دیباگر",
"debugger.debuggerConfiguration": "پیکربندی دیباگر",
"debugger.stopDebugging": "توقف دیباگ",
"debugger.provideTxNumber": "لطفاً یک هش تراکنش معتبر ارائه دهید",
"debugger.startDebugging": "شروع دیباگ",
"debugger.placeholder": "هش تراکنش، باید با 0x شروع شود",
"debugger.debugLocaNodeLabel": "اجبار به استفاده از گره محلی",
"debugger.useGeneratedSources": "استفاده از منابع تولید شده",
"debugger.debugWithGeneratedSources": "در صورت انتخاب، دیباگر همچنین از طریق فایل .yul کامپایل شده در صورت وجود عبور خواهد کرد.",
"debugger.introduction": "هنگام دیباگ با هش تراکنش، اگر قرارداد تأیید شده باشد، Remix سعی خواهد کرد کد منبع را از Sourcify یا Etherscan دریافت کند. کلید API Etherscan خود را در تنظیمات Remix قرار دهید. برای شبکه های پشتیبانی شده، لطفاً ببینید",
"debugger.forceToUseCurrentLocalNode": "دیباگر را مجبور به استفاده از گره محلی فعلی کنید",
"debugger.sourceLocationStatus1": "در حال تعیین محل نقطه شکست، این ممکن است مدتی طول بکشد...",
"debugger.sourceLocationStatus2": "محل منبع در دسترس نیست، نه در Sourcify و نه در Etherscan. لطفاً مطمئن شوید که کلید api Etherscan در تنظیمات ارائه شده است.",
"debugger.sourcifyDocs": "اسناد Sourcify",
"debugger.noDataAvailable": "داده ای موجود نیست",
"debugger.loadMore": "بارگیری بیشتر",
"debugger.copy": "کپی",
"debugger.stepOverBack": "گام به عقب",
"debugger.stepBack": "گام به عقب",
"debugger.stepInto": "گام به داخل",
"debugger.stepOverForward": "گام به جلو",
"debugger.jumpPreviousBreakpoint": "پرش به نقطه شکست قبلی",
"debugger.jumpOut": "پرش به بیرون",
"debugger.jumpNextBreakpoint": "پرش به نقطه شکست بعدی"
}
37 changes: 37 additions & 0 deletions apps/remix-ide/src/app/tabs/locales/ir/editor.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
{
"editor.keyboardShortcuts": "میانبرهای صفحه کلید",
"editor.keyboardShortcuts.text1": "کامپایل قرارداد فعلی",
"editor.keyboardShortacts.text2": "باز کردن کاوشگر فایل",
"editor.keyboardShortcuts.text3": "باز کردن مدیر افزونه",
"editor.keyboardShortcuts.text4": "کامپایل قرارداد فعلی و اجرای اسکریپت مرتبط",
"editor.editorKeyboardShortcuts": "میانبرهای صفحه کلید ویرایشگر",
"editor.editorKeyboardShortcuts.text1": "قالب بندی کد در فایل فعلی",
"editor.importantLinks": "پیوندهای مهم",
"editor.importantLinks.text1": "وب سایت رسمی در مورد پروژه Remix",
"editor.importantLinks.text2": "مستندات رسمی",
"editor.title1": "هشدار کد جایگذاری شده",
"editor.title1.message1": "شما به تازگی یک قطعه کد یا قرارداد را در ویرایشگر جایگذاری کرده اید.",
"editor.title1.message2": "قبل از استقرار یا تعامل با این کد، مطمئن شوید که آن را کاملاً درک کرده اید. کلاهبرداری نشوید!",
"editor.title1.message3": "اجرای کد نامعتبر می تواند کیف پول شما را <span> در معرض خطر </span> قرار دهد. در بدترین حالت، می توانید <span> تمام پول خود را از دست بدهید </span>.",
"editor.title1.message4": "اگر آن را کاملاً درک نمی کنید، لطفاً این کد را اجرا نکنید.",
"editor.title1.message5": "اگر شما یک توسعه دهنده قرارداد هوشمند نیستید، از کسی که به او اعتماد دارید و مهارت های لازم برای تعیین ایمن بودن این کد را دارد، بپرسید.",
"editor.title1.message6": "برای اطلاعات بیشتر <a> این توصیه ها </a> را ببینید.",
"editor.zoomIn": "بزرگنمایی",
"editor.zoomOut": "کوچک نمایی",
"editor.formatCode": "قالب بندی کد",
"editor.generateDocumentation": "تولید مستندات برای این تابع",
"editor.generateDocumentation2": "تولید مستندات برای تابع \"{name}\"",
"editor.generateDocumentationByAI": "```solidity\n {content}\n```\n مستندات natspec را برای تابع {currentFunction} با استفاده از نحو و برچسب های سبک docstring پشتیبانی شده تولید یا بهبود دهید. فقط نظرات و اعلان تابع را برگردانید، نه متن دیگری.",
"editor.explainFunction": "این تابع را توضیح دهید",
"editor.explainFunctionSol": "این کد را توضیح دهید",
"editor.explainFunction2": "تابع \"{name}\" را توضیح دهید",
"editor.explainFunctionByAI": "```\n{content}\n```\nتابع {currentFunction} را توضیح دهید",
"editor.explainFunctionByAISol": "```\n{content}\n```\nتابع {currentFunction} را توضیح دهید",
"editor.ExplainPipeMessage": "```\n {content}\n```\nقطعه بالا را توضیح دهید",
"editor.PastedCodeSafety": "```\n {content}\n```\n\nبه طور خلاصه پاسخ دهید: آیا این کد حاوی آسیب پذیری های امنیتی عمده ای است که منجر به کلاهبرداری یا از دست دادن وجوه می شود؟",
"editor.executeFreeFunction": "اجرای یک تابع آزاد",
"editor.executeFreeFunction2": "اجرای تابع آزاد \"{name}\"",
"editor.toastText1": "این فقط می تواند تابع آزاد را اجرا کند",
"editor.toastText2": "لطفاً به تنظیمات Remix بروید و ویژگی های ویرایشگر کد را فعال کنید یا منتظر بمانید تا زمینه ویرایشگر فعلی بارگیری شود.",
"editor.text": "فایل در حالت <b> فقط خواندنی </b> باز شده است."
}
7 changes: 7 additions & 0 deletions apps/remix-ide/src/app/tabs/locales/ir/electron.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"electron.openFolder": "باز کردن پوشه",
"electron.createProject": "ایجاد پروژه جدید",
"electron.recentFolders": "پوشه های اخیر",
"electron.gitClone": "کلون کردن یک مخزن گیت",
"electron.openFolderMessage": "برای استفاده از ویژگی های گیت، می توانید یک پوشه را باز کنید یا یک مخزن را کلون کنید."
}
Loading