BIG-18: missing locales in Arabic.

This commit is contained in:
a.bouhuolia
2021-09-23 09:48:32 +02:00
parent 364859a793
commit 9b7382e222
11 changed files with 82 additions and 30 deletions

View File

@@ -4,8 +4,9 @@ import { DateInput } from '@blueprintjs/datetime';
import moment from 'moment'; import moment from 'moment';
import intl from 'react-intl-universal'; import intl from 'react-intl-universal';
import { isUndefined } from 'lodash'; import { isUndefined } from 'lodash';
import { useAutofocus } from 'hooks'; import { useAutofocus } from 'hooks';
import { Choose, ListSelect } from 'components'; import { T, Choose, ListSelect } from 'components';
import { momentFormatter } from 'utils'; import { momentFormatter } from 'utils';
function AdvancedFilterEnumerationField({ options, value, ...rest }) { function AdvancedFilterEnumerationField({ options, value, ...rest }) {
@@ -19,7 +20,7 @@ function AdvancedFilterEnumerationField({ options, value, ...rest }) {
minimal: true, minimal: true,
captureDismiss: true, captureDismiss: true,
}} }}
defaultText={`Select an option`} defaultText={<T id={'filter.select_option'} />}
textProp={'label'} textProp={'label'}
selectedItemProp={'key'} selectedItemProp={'key'}
{...rest} {...rest}
@@ -32,8 +33,7 @@ const IFieldType = {
BOOLEAN: 'boolean', BOOLEAN: 'boolean',
NUMBER: 'number', NUMBER: 'number',
DATE: 'date', DATE: 'date',
} };
function tansformDateValue(date, defaultValue = null) { function tansformDateValue(date, defaultValue = null) {
return date ? moment(date).toDate() : defaultValue; return date ? moment(date).toDate() : defaultValue;
@@ -46,13 +46,13 @@ export default function AdvancedFilterValueField2({
fieldType, fieldType,
options, options,
onChange, onChange,
isFocus isFocus,
}) { }) {
const [localValue, setLocalValue] = React.useState(value); const [localValue, setLocalValue] = React.useState(value);
React.useEffect(() => { React.useEffect(() => {
if (localValue !== value && !isUndefined(value)) { if (localValue !== value && !isUndefined(value)) {
setLocalValue(value) setLocalValue(value);
} }
}, [localValue, value]); }, [localValue, value]);
@@ -106,10 +106,10 @@ export default function AdvancedFilterValueField2({
position: Position.BOTTOM, position: Position.BOTTOM,
}} }}
shortcuts={true} shortcuts={true}
placeholder={'Enter date'} placeholder={intl.get('filter.enter_date')}
fill={true} fill={true}
inputProps={{ inputProps={{
fill: true fill: true,
}} }}
/> />
</Choose.When> </Choose.When>
@@ -120,7 +120,7 @@ export default function AdvancedFilterValueField2({
<Choose.Otherwise> <Choose.Otherwise>
<InputGroup <InputGroup
placeholder={intl.get('value')} placeholder={intl.get('filter.value')}
onChange={handleInputChange} onChange={handleInputChange}
value={localValue} value={localValue}
inputRef={valueRef} inputRef={valueRef}
@@ -128,4 +128,4 @@ export default function AdvancedFilterValueField2({
</Choose.Otherwise> </Choose.Otherwise>
</Choose> </Choose>
); );
} }

View File

@@ -108,7 +108,7 @@ function CustomerDetailsActionsBar({
<Button <Button
className={Classes.MINIMAL} className={Classes.MINIMAL}
icon={<Icon icon="pen-18" />} icon={<Icon icon="pen-18" />}
text={intl.get('edit_contact', { name: contact?.contact_service })} text={intl.get('customer.drawer.action.edit')}
onClick={handleEditContact} onClick={handleEditContact}
/> />
<NavbarDivider /> <NavbarDivider />

View File

@@ -1,7 +1,7 @@
import React from 'react'; import React from 'react';
import { useManualJournalDrawerContext } from './ManualJournalDrawerProvider'; import { useManualJournalDrawerContext } from './ManualJournalDrawerProvider';
import { FormatNumber } from '../../../components'; import { T, FormatNumber } from '../../../components';
/** /**
* Manual journal readonly details footer. * Manual journal readonly details footer.
@@ -15,7 +15,9 @@ export default function ManualJournalDrawerFooter() {
<div className="journal-drawer__content-footer"> <div className="journal-drawer__content-footer">
<div class="total-lines"> <div class="total-lines">
<div class="total-lines__line total-lines__line--subtotal"> <div class="total-lines__line total-lines__line--subtotal">
<div class="title">Subtotal</div> <div class="title">
<T id={'manual_journal.details.subtotal'} />
</div>
<div class="debit"> <div class="debit">
<FormatNumber value={amount} /> <FormatNumber value={amount} />
</div> </div>
@@ -24,7 +26,9 @@ export default function ManualJournalDrawerFooter() {
</div> </div>
</div> </div>
<div class="total-lines__line total-lines__line--total"> <div class="total-lines__line total-lines__line--total">
<div class="title">TOTAL</div> <div class="title">
<T id={'manual_journal.details.total'} />
</div>
<div class="debit">{formatted_amount}</div> <div class="debit">{formatted_amount}</div>
<div class="credit">{formatted_amount}</div> <div class="credit">{formatted_amount}</div>
</div> </div>

View File

@@ -43,7 +43,10 @@ export default function ManualJournalDrawerHeader() {
</DetailsMenu> </DetailsMenu>
<div class="journal-drawer__content-description"> <div class="journal-drawer__content-description">
<b class="title">Description</b>: {defaultTo(description, '')} <b class="title">
<T id={'manual_journal.details.description'} />
</b>
: {defaultTo(description, '—')}
</div> </div>
</div> </div>
); );

View File

@@ -91,7 +91,7 @@ function VendorDetailsActionsBar({
<Button <Button
className={Classes.MINIMAL} className={Classes.MINIMAL}
icon={<Icon icon="pen-18" />} icon={<Icon icon="pen-18" />}
text={<T id={'vendor.drawer.action.edit_vendor'} />} text={<T id={'vendor.drawer.action.edit'} />}
onClick={safeCallback(onEditContact)} onClick={safeCallback(onEditContact)}
/> />
<NavbarDivider /> <NavbarDivider />

View File

@@ -9,7 +9,7 @@ export default function PaymentMadesEmptyStatus() {
return ( return (
<EmptyStatus <EmptyStatus
title={<T id={'the_organization_doesn_t_receive_money_yet'} />} title={<T id={'payment_made.empty_status.title'} />}
description={ description={
<p> <p>
<T id="payment_made_empty_status_description" /> <T id="payment_made_empty_status_description" />

View File

@@ -1100,7 +1100,7 @@
"receiving_customer_payments_is_one_pleasant_accounting_tasks": "استلام المدفوعات أحد مهام المحاسبية الأكثر متعة. ستظهر معاملات المدفوعات بمجرد استلام المدفوعات للفواتير.", "receiving_customer_payments_is_one_pleasant_accounting_tasks": "استلام المدفوعات أحد مهام المحاسبية الأكثر متعة. ستظهر معاملات المدفوعات بمجرد استلام المدفوعات للفواتير.",
"estimate_is_used_to_create_bid_proposal_or_quote": "تستخدم العروض لإنشاء عطاء أو اقتراح أو عرض أسعار منتجات. يمكن تحويل العرض إلى أمر مبيعات أو فاتورة.", "estimate_is_used_to_create_bid_proposal_or_quote": "تستخدم العروض لإنشاء عطاء أو اقتراح أو عرض أسعار منتجات. يمكن تحويل العرض إلى أمر مبيعات أو فاتورة.",
"payment_made_empty_status_description": "ستظهر معاملات المدفوعات بمجرد سداد فواتير المشتريات.", "payment_made_empty_status_description": "ستظهر معاملات المدفوعات بمجرد سداد فواتير المشتريات.",
"bill_empty_status_description": "", "bill_empty_status_description": "تسجل المشتريات من الموردين الذين تم او لم يتم الدفع لهم ، لتتبع حساب الذمم الدائنة مع الموردين. ",
"invoices_empty_status_description": "فواتير المبيعات للعملاء الذين لا يسددون أي مدفوعات جزئية أو يسددونها ، مع مساعدتك في تتبع الحسابات المستحقة مع الزبائن.", "invoices_empty_status_description": "فواتير المبيعات للعملاء الذين لا يسددون أي مدفوعات جزئية أو يسددونها ، مع مساعدتك في تتبع الحسابات المستحقة مع الزبائن.",
"receipt_empty_status_description": "إيصالات المبيعات للمبيعات التي يدفع فيها الزبون فورًا مقابل المنتجات أو الخدمات في وقت البيع.", "receipt_empty_status_description": "إيصالات المبيعات للمبيعات التي يدفع فيها الزبون فورًا مقابل المنتجات أو الخدمات في وقت البيع.",
"there_were_no_purchases_during_the_selected_date_range": "لا توجد مشتريات خلال النطاق الزمني المحدد.", "there_were_no_purchases_during_the_selected_date_range": "لا توجد مشتريات خلال النطاق الزمني المحدد.",
@@ -1248,6 +1248,9 @@
"invoice.details.payment_amount": "مبلغ المدفوع", "invoice.details.payment_amount": "مبلغ المدفوع",
"expense.details.subtotal": "المجموع", "expense.details.subtotal": "المجموع",
"expense.details.total": "إجمالي", "expense.details.total": "إجمالي",
"manual_journal.details.subtotal": "المجموع",
"manual_journal.details.total": "إجمالي",
"manual_journal.details.description": "الوصف",
"setup.left_side.title": "سجل منشأة جديدة الأن.", "setup.left_side.title": "سجل منشأة جديدة الأن.",
"setup.left_side.description": "حسابك علي Bigcapital", "setup.left_side.description": "حسابك علي Bigcapital",
"setup.left_side.footer_help": "نحن هنا للمساعدة!", "setup.left_side.footer_help": "نحن هنا للمساعدة!",
@@ -1308,6 +1311,7 @@
"customer.drawer.action.new_payment": "سند زبون جديد", "customer.drawer.action.new_payment": "سند زبون جديد",
"customer.drawer.action.new_receipt": "إيصال جديد", "customer.drawer.action.new_receipt": "إيصال جديد",
"customer.drawer.action.new_transaction": "معاملة جديدة", "customer.drawer.action.new_transaction": "معاملة جديدة",
"customer.drawer.action.edit": "تعديل",
"customer.drawer.label.outstanding_receivable": "مستحق القبض", "customer.drawer.label.outstanding_receivable": "مستحق القبض",
"customer.drawer.label.customer_name": "اسم الزبون", "customer.drawer.label.customer_name": "اسم الزبون",
"customer.drawer.label.customer_type": "نوع الزبون", "customer.drawer.label.customer_type": "نوع الزبون",
@@ -1333,6 +1337,7 @@
"vendor.drawer.action.new_transaction": "معاملة جديدة", "vendor.drawer.action.new_transaction": "معاملة جديدة",
"vendor.drawer.action.new_payment": "سند مورد جديد", "vendor.drawer.action.new_payment": "سند مورد جديد",
"vendor.drawer.action.new_invoice": "فاتورة شراء جديدة", "vendor.drawer.action.new_invoice": "فاتورة شراء جديدة",
"vendor.drawer.action.edit": "تعديل",
"expenses.empty_status.title": "إضافة وإدارة مصاريف مؤسستك", "expenses.empty_status.title": "إضافة وإدارة مصاريف مؤسستك",
"expenses.empty_status.description": "قم بإنشاء وإدارة المصروفات التي تُعد جزء من التكاليف التشغيلية لمؤسستك.", "expenses.empty_status.description": "قم بإنشاء وإدارة المصروفات التي تُعد جزء من التكاليف التشغيلية لمؤسستك.",
"manual_journals.empty_status.title": "قم بإدخال اول القيود اليدوية علي شجرة الحسابات.", "manual_journals.empty_status.title": "قم بإدخال اول القيود اليدوية علي شجرة الحسابات.",
@@ -1359,7 +1364,14 @@
"estimate.field.error.estimate_number_required": "رقم العرض حقل مطلوب ، استخدم وضع الزيادة التلقائي أو أدخل يدويًا.", "estimate.field.error.estimate_number_required": "رقم العرض حقل مطلوب ، استخدم وضع الزيادة التلقائي أو أدخل يدويًا.",
"invoice.field.error.invoice_no_required": "رقم الفاتورة حقل مطلوب ، استخدم وضع الزيادة التلقائي أو أدخل يدويًا.", "invoice.field.error.invoice_no_required": "رقم الفاتورة حقل مطلوب ، استخدم وضع الزيادة التلقائي أو أدخل يدويًا.",
"payment_receive.field.error.payment_receive_no_required": "رقم سند الدفع حقل مطلوب ، استخدم وضع الزيادة التلقائي أو أدخل يدويًا.", "payment_receive.field.error.payment_receive_no_required": "رقم سند الدفع حقل مطلوب ، استخدم وضع الزيادة التلقائي أو أدخل يدويًا.",
"receipt.field.error.receipt_number_required": "رقم الإيصال حقل مطلوب ، استخدم وضع الزيادة التلقائي أو أدخل يدويًا." "receipt.field.error.receipt_number_required": "رقم الإيصال حقل مطلوب ، استخدم وضع الزيادة التلقائي أو أدخل يدويًا.",
"dashboard.rows_height": "ارتفاع الصفوف",
"dashboard.row_small": "صغير",
"dashboard.row_medium": "متوسط",
"filter.select_option": "اختر خيار",
"filter.enter_date": "أدخل تاريخ",
"filter.value": "قيمة",
"payment_made.empty_status.title": "المنشأة لم تدفع اي اموال إلي الموردين ، إلي حد الأن!."
} }

View File

@@ -1219,6 +1219,8 @@
"bill.details.due_amount": "Due amount", "bill.details.due_amount": "Due amount",
"expense.details.subtotal": "Subtotal", "expense.details.subtotal": "Subtotal",
"expense.details.total": "Total", "expense.details.total": "Total",
"manual_journal.details.subtotal": "Subtotal",
"manual_journal.details.total": "Total",
"setup.left_side.title": "Register a New Organization now!.", "setup.left_side.title": "Register a New Organization now!.",
"setup.left_side.description": "You have a Bigcapital account", "setup.left_side.description": "You have a Bigcapital account",
"setup.left_side.footer_help": "Were Here to Help!", "setup.left_side.footer_help": "Were Here to Help!",
@@ -1279,6 +1281,7 @@
"customer.drawer.action.new_payment": "New payment", "customer.drawer.action.new_payment": "New payment",
"customer.drawer.action.new_receipt": "New receipt", "customer.drawer.action.new_receipt": "New receipt",
"customer.drawer.action.new_transaction": "New transaction", "customer.drawer.action.new_transaction": "New transaction",
"customer.drawer.action.edit": "Edit",
"customer.drawer.label.outstanding_receivable": "Outstanding receivable", "customer.drawer.label.outstanding_receivable": "Outstanding receivable",
"customer.drawer.label.customer_name": "Customer name", "customer.drawer.label.customer_name": "Customer name",
"customer.drawer.label.customer_type": "Customer type", "customer.drawer.label.customer_type": "Customer type",
@@ -1304,6 +1307,7 @@
"vendor.drawer.action.new_transaction": "New transaction", "vendor.drawer.action.new_transaction": "New transaction",
"vendor.drawer.action.new_payment": "New payment", "vendor.drawer.action.new_payment": "New payment",
"vendor.drawer.action.new_invoice": "New purchase invoice", "vendor.drawer.action.new_invoice": "New purchase invoice",
"vendor.drawer.action.edit": "Edit",
"manual_journals.empty_status.description": "Manual journals can be used to record financial transactions manually, used by accountants to work with the ledger.", "manual_journals.empty_status.description": "Manual journals can be used to record financial transactions manually, used by accountants to work with the ledger.",
"manual_journals.empty_status.title": "Create your first journal entries on accounts chart.", "manual_journals.empty_status.title": "Create your first journal entries on accounts chart.",
"expenses.empty_status.description": "Create and manage expeses that are part of your organization's operating costs.", "expenses.empty_status.description": "Create and manage expeses that are part of your organization's operating costs.",
@@ -1330,5 +1334,12 @@
"estimate.field.error.estimate_number_required": "Estimate number is required, use auto-increment mode or enter manually.", "estimate.field.error.estimate_number_required": "Estimate number is required, use auto-increment mode or enter manually.",
"invoice.field.error.invoice_no_required": "Invoice number is required, use auto-increment mode or enter manually", "invoice.field.error.invoice_no_required": "Invoice number is required, use auto-increment mode or enter manually",
"payment_receive.field.error.payment_receive_no_required": "Payment receive number is required, use auto-increment mode or enter manually", "payment_receive.field.error.payment_receive_no_required": "Payment receive number is required, use auto-increment mode or enter manually",
"receipt.field.error.receipt_number_required": "Receipt number is required, use auto-increment mode or enter manually" "receipt.field.error.receipt_number_required": "Receipt number is required, use auto-increment mode or enter manually",
} "dashboard.rows_height": "Rows height",
"dashboard.row_small": "Small",
"dashboard.row_medium": "Medium",
"filter.select_option": "Select an option",
"filter.enter_date": "Enter date",
"filter.value": "Value",
"payment_made.empty_status.title": "The organization doesn't pay to vendors, yet!"
}

View File

@@ -84,4 +84,22 @@ export function appIntlIsLoading(toggle) {
type: t.APP_INTL_IS_LOADING, type: t.APP_INTL_IS_LOADING,
payload: { isLoading: toggle }, payload: { isLoading: toggle },
}; };
}
/**
* Splash start loading.
*/
export function splashStartLoading() {
return {
type: t.SPLASH_START_LOADING,
};
}
/**
* Splash stop loading.
*/
export function splashStopLoading() {
return {
type: t.SPLASH_STOP_LOADING,
}
} }

View File

@@ -1,5 +1,5 @@
import { createReducer } from '@reduxjs/toolkit'; import { createReducer } from '@reduxjs/toolkit';
import { isUndefined } from 'lodash'; import { isUndefined, isNumber } from 'lodash';
import t from 'store/types'; import t from 'store/types';
import { persistReducer, purgeStoredState } from 'redux-persist'; import { persistReducer, purgeStoredState } from 'redux-persist';
import storage from 'redux-persist/lib/storage'; import storage from 'redux-persist/lib/storage';
@@ -16,6 +16,7 @@ const initialState = {
topbarEditViewId: null, topbarEditViewId: null,
requestsLoading: 0, requestsLoading: 0,
backLink: false, backLink: false,
splashScreenLoading: null,
appIsLoading: true, appIsLoading: true,
appIntlIsLoading: true, appIntlIsLoading: true,
}; };
@@ -102,14 +103,17 @@ const reducerInstance = createReducer(initialState, {
state.backLink = backLink; state.backLink = backLink;
}, },
[t.APP_IS_LOADING]: (state, action) => { [t.SPLASH_START_LOADING]: (state) => {
const { isLoading } = action.payload; if (isNumber(state.splashScreenLoading)) {
state.appIsLoading = isLoading; state.splashScreenLoading += 1;
} else {
state.splashScreenLoading = 1;
}
}, },
[t.APP_INTL_IS_LOADING]: (state, action) => { [t.SPLASH_STOP_LOADING]: (state) => {
const { isLoading } = action.payload; state.splashScreenLoading -= 1;
state.appIntlIsLoading = isLoading; state.splashScreenLoading = Math.max(state.splashScreenLoading, 0);
}, },
[t.RESET]: () => { [t.RESET]: () => {

View File

@@ -14,6 +14,6 @@ export default {
SET_TOPBAR_EDIT_VIEW: 'SET_TOPBAR_EDIT_VIEW', SET_TOPBAR_EDIT_VIEW: 'SET_TOPBAR_EDIT_VIEW',
SIDEBAR_EXPEND_TOGGLE: 'SIDEBAR_EXPEND_TOGGLE', SIDEBAR_EXPEND_TOGGLE: 'SIDEBAR_EXPEND_TOGGLE',
SET_DASHBOARD_BACK_LINK: 'SET_DASHBOARD_BACK_LINK', SET_DASHBOARD_BACK_LINK: 'SET_DASHBOARD_BACK_LINK',
APP_IS_LOADING: 'APP_IS_LOADING', SPLASH_START_LOADING: 'SPLASH_START_LOADING',
APP_INTL_IS_LOADING: 'APP_INTL_IS_LOADING' SPLASH_STOP_LOADING: 'SPLASH_STOP_LOADING',
}; };