This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Platform, NativeModules } from 'react-native' | |
import I18n from 'i18n-js' | |
import en from './en-US' // importa o objeto de traduções para o idioma inglês | |
import pt from './pt-BR' // importa o objeto de traduções para o idioma português | |
// Função que irá nos auxiliar a normalizar as traduções que serão recebidas pela função getLanguageByDevice | |
// Isso é necessário pois no android e no iOS o retorno do mesmo idioma pode ser diferente | |
// Exemplo: no iOS podemos receber pt_US e no android pt_BR para o idioma português Brasil. | |
const normalizeTranslate = { | |
'en_US': 'en_US', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Copyright (c) 2016-2018 Ming Qin (覃明) <https://github.com/QinMing> | |
# Open source under MIT LICENSE. | |
lazy_load() { | |
# Act as a stub to another shell function/command. When first run, it will load the actual function/command then execute it. | |
# E.g. This made my zsh load 0.8 seconds faster by loading `nvm` when "nvm", "npm" or "node" is used for the first time | |
# $1: space separated list of alias to release after the first load | |
# $2: file to source | |
# $3: name of the command to run after it's loaded | |
# $4+: argv to be passed to $3 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Create an image with the desired size on-the-fly. | |
* | |
* @param $image_id | |
* @param $width | |
* @param $height | |
* @param $crop | |
* | |
* @return array | |
*/ |