How to use locale - 10 common examples

To help you get started, we’ve selected a few locale examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github samuelmaddock / metastream / packages / metastream-app / src / components / browser / Controls.tsx View on Github external
private renderLocation(): JSX.Element {
    return (
      <div>
        <div>
          <input> {
              this.addressInput = el
            }}
            type="text"
            className={styles.addressInput}
            onKeyPress={this.onLocationKeyPress}
            onChange={() =&gt; {
              /* force react controlled input */
              this.onAddressChange()
            }}
            placeholder={t('requestUrlPlaceholder')}
            spellCheck={false}
            autoFocus
          /&gt;
        </div>
      </div>
    )
  }
github samuelmaddock / metastream / packages / metastream-app / src / components / lobby / modals / Invite.tsx View on Github external
private renderURL() {
    return (
      <section>
        <p>{t('shareSessionUrl')}</p>
        
      </section>
    )
  }
}
github samuelmaddock / metastream / packages / metastream-app / src / components / SessionJoin.tsx View on Github external
if (valid) {
                    const value = this.sessionInput!.value.trim()
                    localStorage.setItem('prevFriendCode', value)
                    this.props.connect(value)
                  } else {
                    this.sessionInput!.classList.add('invalid')
                  }
                }}
              &gt;
                {t('join')}
              
            
          
        
        <section>
          <h2>{t('findSession')}</h2>
          <p>
            
              Join the <strong>#sessions</strong> channel on the {PRODUCT_NAME} Discord community to
              find other users’ sessions. Click the Discord logo below to join.
            
            
              <img alt="Discord" src="{assetUrl('icons/social/discord-color.svg')}">
            
          </p>
        </section>
      
    )
github samuelmaddock / metastream / packages / metastream-app / src / components / chat / Messages.tsx View on Github external
render(): JSX.Element | null {
    const messages = this.props.messages.map(message =&gt; (
      
    ))

    return (
      <div>
        <ul> (this.list = el)} className={styles.messages}&gt;
          {messages}
        </ul>
        {this.state.hasNewMessage &amp;&amp; (
          <div>
            {t('chatNewMessage')}
          </div>
        )}
      </div>
    )
  }
}
github samuelmaddock / metastream / packages / metastream-app / src / components / settings / sections / Profile.tsx View on Github external
<label>{t('displayName')}</label>
         (this.usernameInput = e)}
          defaultValue={this.props.username}
          maxLength={USERNAME_MAX_LEN}
          onChange={this.onChangeUsername}
          onBlur={e =&gt; {
            if (this.usernameInput) {
              this.usernameInput.value = this.props.username
            }
          }}
        /&gt;

        <label>{t('chatColor')}</label>
        <input type="color" id="profile_color"> {
            this.props.dispatch(setColor(e.target!.value))
            this.setState({ dirty: true })
          }}
        /&gt;
      
    )
  }
github samuelmaddock / metastream / app / renderer / components / settings / SettingsMenu.tsx View on Github external
render(): JSX.Element | null {
    if (this.state.hide) return null

    return (
      
        
        <div>
          
          
          
          
        </div>
      
    )
  }
}
github samuelmaddock / metastream / packages / metastream-app / src / components / common / input.tsx View on Github external
render() {
    return (
      <div>
        <input> (this.input = e)}
          className={cx(this.props.inputClassName, styles.textInput)}
          type="text"
          defaultValue={this.props.defaultValue}
          disabled={this.props.disabled}
        /&gt;
        
          {t('copy')}
        
      </div>
    )
  }
github samuelmaddock / metastream / packages / metastream-app / src / components / media / PlaybackControls.tsx View on Github external
onClick={() =&gt; {
              PopupWindow.focus()
              this.props.dispatch(setPopupPlayer(true))
            }}
          &gt;
            Open in popup
          
        ) : null}
        
          {t('openInBrowser')}
        
        
          {t('copyLink')}
        
        
          {t('reload')}
        
      
    )

    return (
      
         this.props.toggleChat()}&gt;
          {t('chat')}
        
         this.props.showInteract()}&gt;
          {t('interact')}
        
        {mediaButtons}
      
    )
  }
github samuelmaddock / metastream / app / renderer / components / media / PlaybackControls.tsx View on Github external
{t('extensions')}
      
    )

    const mediaButtons = media &amp;&amp; (
      &lt;&gt;
        
          {t('openInBrowser')}
        

        
          {t('copyLink')}
        

        
          {t('reload')}
        

        <hr>
      
    )

    return (
      
        
          <hr>
        
        {mediaButtons}
        {extensionsBtn}
        {debugBtn}
      
    )

locale

Browser locale negotiation for node.js

MIT
Latest version published 8 years ago

Package Health Score

54 / 100
Full package analysis

Popular locale functions