loc-to-region

0.1.1 • Public • Published

To use the localization method, first create a folder called /locale/ in the root of your project, and inside that folder name each sub-folder after a locale. Create one .properties file in each folder and include in the router like this:

To install in a project, run this command:

npm install @haven/loc-to-region --save

Then put the code in your express router like this:

var loc_region = require('@haven/loc-to-region');
var gtm_locale = loc_region.localeReplace(regions,req.params.locale);

Express is not required.

Thanks for using!

-Daniel @ Haven

  ``````````````````````````````````````````````````````````````````````````````````````````````````````````````````     
 ``                                                                                                                ``    
 `                                                                                                                  `    
 `                                                                                                                  `    
``                                                                                                                  ``   
``                                                                                                                  ``   
``                                                                                                                  ``   
``                                                                                                                  ``   
``                                                                                                                  ``   
``                                                       `````                                                      ``   
``                                          .       ```````..``                                                     ``   
``                                        .`:` `````.....```,,``                                                    ``   
``                                      .,::'';::,:;;;:,...,++;;:`                                                  ``   
``                                     `,;;;'';;'+++++++++++++''::`                                                 ``   
``                                  ```.:;''''''+++++++#####+++'':,.` ``                                            ``   
``                                 `..`,;++'''''+++++++######++''':,.``.                                            ``   
``                                 ,`,.,'+++'++++++##+########+++'';;,,;`                                           ``   
``                                 :.,:;'+++++++++##++###########+++++';.                                           ``   
``                                `;;:;'++++++++++##++#############+++';.`                                          ``   
``                                .';;'++++''++'++##++#########+##+++++',. ```                                      ``   
``                                .;;;'++++'''''++++++#####+++++++++++++;.`.::`                                     ``   
``                               ``.,;'+++++++'++++'+++#+++''''+++''++++';;:::.                                     ``   
``                               .``.'+##++++'++;''+++++++';''+++++++++'+++';:,                                     ``   
``                               ,..,'#####++++++++++++++';;+++++++++++'+++';;;,                                    ``   
``                              `:::;'+#####+++++++++++';;,'++++++##++;+#+++;;;:`                                   ``   
``                              `;'++++#####+++++++++++;:,,;'+++++##+''+#++++';,`                                   ``   
``                              `.;++++#########+++++';,...,'+++++##+++''+++++':.                                   ``   
``                              .:'++++#########+++'';,..``.'++'''###++''+##+++'.                                   ``   
``                             `:;'++'+#########++';;:``.``.;';;;;+###########';.                                   ``   
``                             .:;;;'++########++';;:.  `  .,;:,::;++####+###+':.`                                  ``   
``                             `.:'++########++';;;:.`  `  `,;,,,,:'++##++##++':.                                   ``   
``                             `.;+#########++';;;:,````````:;:;;;;'++++++#++'';,                                   ``   
``                             .:'+#########++';;''';:,.```.::;;'''';'++####++'':                                   ``   
``                             ,;'+#########++';;''+'';,....,:;''';::;'+#####++';``                                 ``   
``                             `;'+###@#####+';:,,,:'';;,```.;;:,..,::;'+#####+'';.                                 ``   
``                             .;'++##@####+';::,,,,:;;;,`  .,:;+#';:,,:'#####++++,`                                ``   
``                            `:;'+####@@#+';:::;'++,,,..````.,.,,,::...:+####++++:.                                ``   
``                            .;'+#####@@#':,,,:;:,..``..````.........`.,'####++++:,`                               ``   
``                           `:'+#########;,..`......``...```.`````````.,;#####++;:,`                               ``   
``                           `:'+######+#+:,..`````````...```.```````...,;#####+'';.                                ``   
``                            :'+########+:,....``````....```````````....;#####++';`                                ``   
``                            ,;+########+:,.....`````...`` ```.`````...,;#####++':`                                ``   
``                            `;'########+;:.....````.....` ``....``....,;#####++'.                                 ``   
``                            `;'########+;:,,,..````.,,,,,..,::,.......,;#####+':                                  ``   
``                             :;+#####+++':,,,...`.`.'+++'''''',``....,,;+####';,                                  ``   
``                             `'+######+++;:,,....```:;;'+++';:.```...,,;'###+':`                                  ``   
``                              ,'+#####';+;::,,..````,,,,;';,,,...``.,,,;'##+':.                                   ``   
``                               ,+#####;:+;::,,...``.,,,,...,,,....`.,,,'##+;,`                                    ``   
``                               `'+##@@+;+';:,,......,,:;;,:::::,.....,:'#+,`                                      ``   
``                                .'##@@###+;:,,..,,,:::::;;;;;;;':,...,:'++                                        ``   
``                                `:+#@@@@@+;:,...,:+++';::;,...'+;,...,:++:                                        ``   
``                                `.:+#@@@@#;:,....:,;',,`````.,;,.....,;+;`                                        ``   
``                                `.,:;###@#';:,.....,::::. `.:::......:'+:                                         ``   
``                                `,,;####@@+;:,.....,,:::,,.,,,,.....,:'+,                                         ``   
``                                .,:#####@@#';:,.....,:::...,,,.....,:;++;                                         ``   
``                                .,;+####@@##';:.....,,,,,,,,,,.....,;'+'.`       ```                              ``   
``                               `,:'+#####@@#+';:,,...,,,,,,,,.....,:'++,.`       .```                             ``   
``                               .,;'+#@###@@##+';:,...,,,,,,,,.....,;+++',.       ,...`                            ``   
``                               .:''+#@@##@@###+';,,...............:+##++;,`      `:...                            ``   
``                              `.:'''######@####+':,...............;+##',,,.`      :....                           ``   
``                              `,;'''+#+++########':,...........,,,'+##..`.,.`     .,...`                          ``   
``                              .:'''''++''+#+#####+':,,,......,,,:;'+##,.```.``    `:,.``                          ``   
``                             `;'''''''''''+''+####+::,,,,,,,,,::;''+##',.```.```````,.``                          ``   
``                             .'''''''''''''::;+####';:::::::::;;'''##+'',.````.`````..```                         ``   
``                             ;''''''''''''';,:;+####+';;;;;;;;'''''#+'''',.````````...``.                         ``   
``                             ''''''''''''''',,,;+####+++++++''''''+#+''''':.`  ````..,.``.                        ``   
``                            :''''''''''''''';,,,'###########++''''#+''''''':.`  ``...,.``.`                       ``   
``                           `''''''''''''''''';,,,+##########++'''+#+'''''''':.` ```..:..``.                       ``   
``                          `''''''''''''''''''';,,;+#########++''+#''''''''''';,`````.,,.````                      ``   
``                          ''''''''''''''''''''';,,+#########++++##+''''''''''';,`````...```.                      ``   
``                         ;'''''''''''''''''''''';:;+########+++###''''''''''''';,..````..``.`                     ``   
``                         +'''''''''''''''''''''''';+########++###+''''';'''''''';,.`````.```.                     ``   
``                        .''''''''''''''''''''''''''++############'''''''''''''''';..``````````                    ``   
``                       `'''''''''''''''''''''''''''''+##########+''''''''''''''''':,.````````.                    ``   
``                       ;'''''''+++'''''''''''''''''''''+++######'''''''''''::;'''';:,.```````.`                   ``   
``                   .';;''''''''''+++++''''''''''''''''+'''++++++''''''''';:..``,:;;::,.``````..                   ``   
``                   ''''''''''''''''++++++++'''''''''''''''''''''''''''''';,.``````,:,,,.`````..                   ``   
``                  ''''''''''''''''''''''++##++++++''''''''''''''''''''''';:,.`````````..`````...                  ``   
``              ```'''''''''''''''''''''''''''+########++''++++''''''''''''';;,.``````` ```````..,                  ``   
``            `'''''''''''''''''''''''''''''''''+++######'++++++'''''''+'''''':,.``````` `````..,,`                 ``   
``            '''''''''''''''''''''''''''''''''''''''+++++'++'''''''''++++''''':,..`````` ````.,,,``                ``   
``            +'''''''''''''''''''''''''''''''''''''''''++'''''''''''''++++'''';;;,..`````````.,,,,`                ``   
``            '''''''''''''''''''''''''''''''''''''''''''+'''''''''''''++++++''''+';,..```````...,,`                ``   
``            '''''''''''''''''''''''''''''''''''''''''''+''''''''''''''++#+++,...,'':..`````....,,,                ``   
``            '''''''''''''''''''''';;'''''''''''''''''''''''''''''''''''+###'....``.::..```.....,,,:`              ``   
``            '''''''''''''''''''''';;''''''''''''''''''''+''''''''''''''+###'....````....`....,,,,,;`              ``   
``            ''''''''''''''''''''';;;''''''''''''''''''''+''''''''''''''+++#+,...````````....,,,,,,::              ``   
``            '''''''''''''''''''''';;''''''''''''''''''''+''''''''''''''+':,:':,..```````...,,,,,,,:;`             ``   
``            '''''''''''''''''''''';;''''''''''''''''''''+''''''''''''''`  `.:':,.....``...,,,,,,,,,;`             ``   
``            '''''''''''''';;''''''';'''''''''''''''''''''''''''''''''', ```,;'';,...........,,,,,,,:,`            ``   
``            '''''''''''''''''''''''''''''''''''''''''''''''''''''''''',``.#:''+'':,..,,,,....,,,,,,,;`            ``   
``            '''''''''''''''''''''''''''''''''''''''''''''+'''':.``  :'; .:'''+++++;:,,,,,.....,,,,,,,,`           ``   
``            '''''''''''''''''''''''''''''''''''''''''''':,' .;     `.',`.:;''++++#';:,,,,,....,,,,,,..            ``   
``                                                                                                                  ``   
``            ;'''''` ,'''`   ''';  ''''    ;'''       `''''''':     ;'''   `''',  ''''''';`    `''''''':           ``   
``          .'''''''` ,'''`   ''';  ''''    ;'''       `''''''''';   ;'''   `''',  ''''''''''   `''''''':           ``   
``          ''''';''` ,'''`   ''';  ''''    ;'''       `'''''''''';  ;'''   `''',  '''''''''''  `''''''':           ``   
``          ''''    ` ,'''`   ''';  ''''    ;'''       `''',  ;''''  ;'''   `''',  ''';  :''''` `'''.               ``   
``          ''''.     ,'''`   ''';  ''''    ;'''       `''',   ''''. ;'''   `''',  ''';   ;'''; `'''.               ``   
``          '''''',   ,'''`   ''';  ''''''''''''       `''',   ,''': ;'''   `''',  ''';    '''' `'''''''`           ``   
``          `'''''''  ,'''`   ''';  ''''''''''''       `''',   .'''; ;'''   `''',  ''';    '''' `'''''''`           ``   
``            ;'''''; ,'''`   ''';  ''''''''''''       `''',   :''': ;'''   `''',  ''';   `'''; `'''''''`           ``   
``              :'''' .''',  `''':  ''''    ;'''       `''',   ''''` :'''`  ,'''.  ''';   ;''', `'''.               ``   
``          ;    ''''  ''''` ''''`  ''''    ;'''       `''', `'''''  .'''' `''''   ''';  ;''''  `'''.               ``   
``          '''''''';  ''''''''''   ''''    ;'''       `''''''''''`   ''''''''''   '''''''''',  `''''''''           ``   
``          ''''''''    ''''''''`   ''''    ;'''       `'''''''''`    `''''''''    ''''''''',   `''''''''           ``   
``          :''''':      :'''';     ''''    ;'''       `'''''';.        ;'''':     '''''';,     `''''''''           ``   
``                                                                                                                  ``   
``                                                                                                                  ``   
``                                                                                                                  ``   
``                                                                                                                  ``   
``                                                                                                                  ``   
``                                                                                                                  ``   
 `                                                                                                                  `    
 `                                                                                                                  `    
  ```                                                                                                            ```     
   ````````````````````````````````````````````````````````````````````````````````````````````````````````````````    

Readme

Keywords

Package Sidebar

Install

npm i loc-to-region

Weekly Downloads

0

Version

0.1.1

License

ISC

Last publish

Collaborators

  • dp0220