Skip to content
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

add flowcharts for modules #157

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
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
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
Loading