Skip to content

Commit

Permalink
add flowcharts
Browse files Browse the repository at this point in the history
  • Loading branch information
RgnDunes committed Jun 14, 2024
1 parent 0a35206 commit 69c1032
Showing 1 changed file with 56 additions and 0 deletions.
56 changes: 56 additions & 0 deletions packages/i18nify-js/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,15 @@ Go on, code conqueror, the adventure awaits!

Welcome to the command center for your i18n experience! This module serves as the control hub, housing the essential functions to manage your i18n settings seamlessly. This module offers a trio of functions to handle all your i18n needs. Whether it's checking the current state, customizing settings, or starting afresh, this module has got you covered in managing your i18n world! 🚀

#### Flowcharts

```mermaid
flowchart TD
A[Core Module] --> B[setState]
A --> C[getState]
A --> D[resetState]
```

#### Functions

**setState(newState: Partial `<I18nState>`):** Customize and update your i18n state with ease! Whether you're changing locales or tweaking directions, this function is your ticket to tailor your i18n experience precisely how you want it! 🎨
Expand Down Expand Up @@ -68,6 +77,18 @@ resetState();

This module's your go-to guru for everything currency/number-related. 🤑 It's all about formatting, validations, and handy tricks to make dealing with money/numbers a breeze. Here are the cool APIs and utilities this Currency Module gives you to play with! 🚀💸

#### Flowcharts

```mermaid
flowchart TD
E[Module 01: Currency] --> F[convertToMajorUnit]
E --> G[convertToMinorUnit]
E --> H[formatNumber]
E --> I[getCurrencyList]
E --> J[getCurrencySymbol]
E --> K[formatNumberByParts]
```

#### convertToMajorUnit(amount, options)

💵🔄 This function is your go-to tool for scaling currency values from lower to major units. Just input the amount in a minor unit (like cents or pence) along with the currency code, and voilà! You get the amount in a major unit (like dollars or pounds). And if you stumble upon an unsupported currency code, it'll promptly let you know by throwing an error.
Expand Down Expand Up @@ -387,6 +408,18 @@ console.log(

This module's your phone's best friend, handling all things phone number-related. 📱 It's the go-to for formatting, checking if those digits are legit, and all those handy phone-related tricks. And guess what? It's got a bunch of cool stuff—APIs and utilities—just waiting for you to dive in and make your phone game strong! 🚀🔢

#### Flowcharts

```mermaid
flowchart TD
L[Module 02: Phone Number] --> M[isValidPhoneNumber]
L --> N[formatPhoneNumber]
L --> O[parsePhoneNumber]
L --> P[getDialCodes]
L --> Q[getDialCodeByCountryCode]
L --> R[getMaskedPhoneNumber]
```

#### isValidPhoneNumber(phoneNumber, countryCode)

📞 It's like the phone number detective, using fancy patterns to check if a number is the real deal for a specific country code. So, it's pretty simple: if it says true, your number's good to go for that country; if it's false, time to double-check those digits! 🕵️‍♂️🔍
Expand Down Expand Up @@ -641,6 +674,18 @@ The Geo Module is designed to enrich your applications by providing easy access
>
> These countries are 'IN', 'MY', 'SG' and 'US'.
#### Flowcharts

```mermaid
flowchart TD
S[Module 03: Geo Module] --> T[getAllCountries]
S --> U[getStates]
S --> V[getCities]
S --> W[getZipcodes]
S --> X[getFlagOfCountry]
S --> Y[getFlagsForAllCountries]
```

#### getAllCountries

Looking for a global adventure? The getAllCountries API is your passport to a world of fun facts! Get ready to explore every country on the map, complete with cool details like names, languages, currencies, dial codes, and even their snazzy flags.
Expand Down Expand Up @@ -928,6 +973,17 @@ Behold, an object where each key is a country code linked to its flag's URL, suc

This module provides functions for formatting and manipulating dates and times in a locale-sensitive manner using the JavaScript Intl API & Date object.

#### Flowcharts

```mermaid
flowchart TD
Z[Module 04: Date & Time Module] --> AA[formatDateTime]
Z --> AB[getRelativeTime]
Z --> AC[getWeekdays]
Z --> AD[parseDateTime]
Z --> AE[Calendar, CalendarDate, CalendarDateTime, Time, ZonedDateTime]
```

#### formatDateTime(date, options)

🛠️ Dive into the sophistication of formatDateTime, a highly configurable function designed for developers seeking to master the intricacies of international date and time formatting. Leveraging the robust capabilities of the Intl.DateTimeFormat API, this utility offers unparalleled precision and adaptability in crafting date-time strings. Whether your application caters to a global audience or requires meticulous timestamping, formatDateTime delivers the versatility and accuracy essential for modern software development. 🌍🔧
Expand Down

0 comments on commit 69c1032

Please sign in to comment.