Skip to content

Instantly share code, notes, and snippets.

View pavanjoshi914's full-sized avatar
🚩

Pavan Joshi pavanjoshi914

🚩
View GitHub Profile
@pavanjoshi914
pavanjoshi914 / gist:2455397ffd20b4d9639ed91494d67e13
Last active April 10, 2021 13:51
internationalization for rails platform

Strategy for internationalization of rails platform

Configuration of I18n module:

I18n basic configuration already done in CircuitVerse platform.Changes can be done according to file structure of locales we will use

Locale Setup:

can be done in two ways : 1> define explicitly or by inferring locale

  • Using HTTP GET parameters for setting up locale
  • Using domain name
  • Setup locale according to user preference (Via forms and UI widgets)
@pavanjoshi914
pavanjoshi914 / jekyll.md
Last active March 22, 2021 01:45
Internationalization of interactive book (for jekyll framework)

jekyll dont provide any official documentation for internationalization,below info generated by reading docs of different jekyll multilangual plugins

jekyll plugins

more popular i18n plugns for jekyll are jekyll multiple language plugin ,jekyll-polygot, jekyll-i18n.

jekyll and githubpages

list of supported plugins is given here which does not indclude any of the i18n plugin.but by having CI setup can make unsupported plugin work for us.

there is no native i18n support provided by jekyll,but can be achieved through plugins or by providing i18n support from scratch.

@pavanjoshi914
pavanjoshi914 / circuitversedocs.md
Last active March 22, 2021 01:44
i18n for circuitversedocs

I18n for CircuitVerseDocs

Overview

Currently circuitversedocs is made using Docsifyjs documentation site generator which can be internationalised easily.

structure of i18n

  • use different repositories for each language.
  • use same repository with subfolders for each language.

different sections we have to work on

@pavanjoshi914
pavanjoshi914 / gist:1cebce0f55539be221473abd04aaceaf
Last active February 28, 2022 14:26
Comparison of different Jekyll plugins

Popularly known Jekyll I18n plugins are Jekyll-multiple-language plugin, Jekyll-polyglot, Jekyll-I18n

Maintenance of different plugins for I18n support

Jekyll-I18n

Jekyll-I18n enables basic level support for I18n but is no longer maintained anymore and cant' be used for proper I18n support for Interactive-Book.

Jekyll multiple language plugin

  • Jekyll-multiple-language-plugin is a traditional plugin to provide I18n in Jekyll.
  • It is also a properly maintained plugin with the latest stable release but follows more manual approach.
@pavanjoshi914
pavanjoshi914 / gist:d5523248a3e51cea0c07a4e47c080d1e
Last active April 13, 2021 10:09
Comparison between different backends for model translations

Difference between different Backends

Column Backend

  • Creation of localized version of each attribute
  • eg: title_en, title_fr, title_ja,
  • mobility supports this using :column backend

Disadvantages

  • not scalable when we support large number of locales due to increase in number of columns in the database
  • Every time migration is required to introduce new attrbiute or locale

Table Backend

  • Each model will have its separate translation model
@pavanjoshi914
pavanjoshi914 / views.md
Last active June 19, 2021 12:32
I18n rules

Rules for designing directory structure for I18n

  • we support nested directory structure, all the yml files belonging to views should be stored in config/locales/views folder
  • Further nesting should be done following similar codebase structure.

Some of the cases that occur more frequently

  • case1:

If there is single file in module we dont include erb name for file. here we use view_folder_name: i.e about: as a top level namespace

@pavanjoshi914
pavanjoshi914 / gist:fbd6ce04fe46dddfb6a4248f32391c95
Created July 8, 2021 07:57
Curated list of locale and their language name
[
["English", "en"],
["Portuguese", "pt"],
["Japanese", "ja"],
["Swedish", "sv"],
["German", "de"],
["Bulgarian", "bg"],
["Turkish", "tr"],
["Indonesian", "id"],
["French", "fr"],
@pavanjoshi914
pavanjoshi914 / chatbot.md
Created December 2, 2021 17:35
Chatbot

intents.json

{"intents": [
        {"tag": "greeting",
         "patterns": ["Hi there", "How are you", "Is anyone there?","Hey","Hola", "Hello", "Good day"],
         "responses": ["Hello, thanks for asking", "Good to see you again", "Hi there, how can I help?"],
         "context": [""]
        },
        {"tag": "goodbye",
Scaffold(
floatingActionButton: buildSaveDeletebutton()
);