A modern JavaScript SDK for Ethiopian web applications with Amharic transliteration, Ethiopian calendar conversion, Geez numerals, and multi-language support.
Click the image below to watch our project video:
https://youtube.com/shorts/qNbTvrurcp8?feature=share
Try the interactive demo: Open Demo
Experience real-time Amharic transliteration, Ethiopian calendar conversion, Geez numerals, and multi-language support!
npm install ethio-intl
yarn add ethio-intl
pnpm add ethio-intl
import { toEthDate, toEthNumber } from 'ethio-intl';
// Ethiopian Calendar
const today = new Date();
const ethDate = toEthDate(today, 'en');
// Result: "Tahsas 13, 2018"
const ethDateAmharic = toEthDate(today, 'am');
// Result: "แณแ
แณแต 13, 2018"
// Geez Numerals
const geezNumber = toEthNumber(2025);
// Result: "แณแปแณแญ"
const geez100 = toEthNumber(100);
// Result: "แป" (note: no '1' multiplier)
toEthDate(date, lang?)Convert Gregorian date to Ethiopian date.
import { toEthDate } from 'ethio-intl';
const ethDate = toEthDate(new Date(2025, 8, 11), 'en');
// Result: "Meskerem 1, 2018"
const ethDateAmharic = toEthDate(new Date(2025, 8, 11), 'am');
// Result: "แแตแจแจแ 1, 2018"
isEthiopianLeapYear(year)Check if Ethiopian year is a leap year.
import { isEthiopianLeapYear } from 'ethio-intl';
isEthiopianLeapYear(2018); // true
isEthiopianLeapYear(2017); // false
toEthNumber(num)Convert Arabic number to Geez numerals.
import { toEthNumber } from 'ethio-intl';
toEthNumber(1); // "แฉ"
toEthNumber(10); // "แฒ"
toEthNumber(100); // "แป"
toEthNumber(1000); // "แฒแป"
toEthNumber(2025); // "แณแปแณแญ"
fromEthNumber(geezString)Convert Geez numerals to Arabic number.
import { fromEthNumber } from 'ethio-intl';
fromEthNumber('แณแปแณแญ'); // 2025
fromEthNumber('แป'); // 100
EthioProviderReact Context provider for internationalization.
import { EthioProvider } from 'ethio-intl';
const translations = {
en: { translation: { welcome: 'Welcome!' } },
am: { translation: { welcome: 'แฅแแณแ แฐแ
แ แแก!' } }
};
function App() {
return (
<EthioProvider
resources={translations}
defaultLang="am"
fallbackLang="en"
>
<YourComponents />
</EthioProvider>
);
}
useEthioIntlCustom hook for accessing internationalization context.
import { useEthioIntl } from 'ethio-intl';
function MyComponent() {
const { t, changeLanguage, currentLang } = useEthioIntl();
return (
<div>
<h1>{t('welcome')}</h1>
<button onClick={() => changeLanguage('am')}>
Switch to Amharic
</button>
</div>
);
}
useTransliterateHook for real-time Amharic transliteration.
import { useTransliterate } from 'ethio-intl';
function TransliterComponent() {
const [text, setText] = useState('');
const translated = useTransliterate(text);
return (
<div>
<input
value={text}
onChange={(e) => setText(e.target.value)}
placeholder="Type in English..."
/>
<p>Amharic: {translated}</p>
</div>
);
}
// Ethiopian banking date formatting
const transactionDate = toEthDate(new Date(), 'am');
console.log(`แแ: ${transactionDate}`);
// Product pricing in Geez numerals
const price = toEthNumber(2500);
console.log(`แแ: ${price} แฅแญ`);
// Traditional date display
const today = new Date();
const ethDate = toEthDate(today, 'am');
const geezYear = toEthNumber(today.getFullYear());
console.log(`แจแแ แแ: ${ethDate.replace(/\d{4}$/, geezYear)}`);
// Official document dating
const officialDate = toEthDate(new Date(), 'am');
console.log(`แแ: ${officialDate}`);
const customTranslations = {
en: {
translation: { hello: 'Hello' },
custom: { greeting: 'Welcome' }
},
am: {
translation: { hello: 'แฐแแ' },
custom: { greeting: 'แฅแแณแ แฐแ
แ แแก' }
}
};
<EthioProvider resources={customTranslations}>
<App />
</EthioProvider>
const { loadNamespace, loadTranslations } = useEthioIntl();
// Load page-specific translations
useEffect(() => {
loadNamespace('en', 'dashboard', dashboardEn);
loadNamespace('am', 'dashboard', dashboardAm);
}, []);
| Language | Code | Status |
|---|---|---|
| Amharic | am |
โ Full Support |
| English | en |
โ Full Support |
| Tigrinya | ti |
โ Full Support |
| Oromo | om |
โ Full Support |
# Run tests
npm test
# Run tests with coverage
npm run test:coverage
# Run tests in watch mode
npm run test:watch
# Development build with watch
npm run dev
# Production build
npm run build
# Type checking
npm run type-check
# Linting
npm run lint
We welcome contributions! Please see our Contributing Guide for details.
git checkout -b feature/amazing-feature)git commit -m 'Add amazing feature')git push origin feature/amazing-feature)This project is licensed under the MIT License - see the LICENSE file for details.
Made with โค๏ธ for the Ethiopian developer community