Initial deploy
هذا الالتزام موجود في:
21
data/portfolio/helpers.ts
Normal file
21
data/portfolio/helpers.ts
Normal file
@@ -0,0 +1,21 @@
|
||||
import { englishPortfolioContent } from "./en";
|
||||
import { arabicPortfolioContent } from "./ar";
|
||||
import type { Language, PortfolioDictionary } from "./types";
|
||||
|
||||
export const languages: Language[] = ["en", "ar"];
|
||||
|
||||
export function isLanguage(value: string): value is Language {
|
||||
return languages.includes(value as Language);
|
||||
}
|
||||
|
||||
export function getDirection(language: Language) {
|
||||
return language === "ar" ? "rtl" : "ltr";
|
||||
}
|
||||
|
||||
export function getBasePath(language: Language) {
|
||||
return `/${language}`;
|
||||
}
|
||||
|
||||
export function getPortfolioContent(language: Language): PortfolioDictionary {
|
||||
return language === "ar" ? arabicPortfolioContent : englishPortfolioContent;
|
||||
}
|
||||
المرجع في مشكلة جديدة
حظر مستخدم