Skip to content

Instantly share code, notes, and snippets.

View theodesp's full-sized avatar
🦄
Jumping over Rainbows...

Theofanis Despoudis theodesp

🦄
Jumping over Rainbows...
View GitHub Profile
➜ ./phraseapp pull
Downloaded en to en.all.json
Downloaded de to de.all.json
Theo/Projects/phraseapp-api
➜ ls
de.all.json en.all.json phraseapp
Theo/Projects/phraseapp-api
➜ cat de.all.json
➜ ./phraseapp projects list | jq
[
{
"account": {
"company": "",
"created_at": "2018-06-26T08:35:41Z",
"id": "597581c0",
"name": "Dynport GmbH",
"updated_at": "2019-02-05T15:01:36Z"
},
{
"id": "general.test",
"translation": "Test"
},
➜ ./phraseapp push
Uploading de.all.json... done!
Check upload ID: ba66d11bea716dd09ff4e56e750525f6, filename: de.all.json for information about processing results.
Uploading en.all.json... done!
Check upload ID: 6c34dd66483661b49be8eae837e1dd7f, filename: en.all.json for information about processing results.
package main
import (
"github.com/phrase/phraseapp-go/phraseapp"
"os"
"fmt"
"log"
)
func main() {
$> export PHRASE_APP_TOKEN=<token> && go run main.go
PROJECT LIST
____________
Test
WP POT File Test
Handmade's Tale
@theodesp
theodesp / install-angular.sh
Created April 4, 2019 20:02
install-angular
➜ npm install -g @angular/cli
➜ ng new my-i18n-app
? Would you like to add Angular routing? Yes
? Which stylesheet format would you like to use? SCSS [ http://sass-lang.com/documentation/file.SASS_REFERENCE.html#syntax ]
...
@theodesp
theodesp / install i18next
Created April 4, 2019 22:11
install i18next
➜ npm install i18next angular-i18next --save
import { BrowserModule, Title } from '@angular/platform-browser';
import { NgModule, APP_INITIALIZER, LOCALE_ID } from '@angular/core';
import { I18NextModule, ITranslationService, I18NEXT_SERVICE, I18NextTitle, defaultInterpolationFormat } from 'angular-i18next';
import { AppRoutingModule } from './app-routing.module';
import { AppComponent } from './app.component';
export function appInit(i18next: ITranslationService) {
return () => i18next.init({
<div style="text-align:center">
<h1>
{{ 'message' | i18next }}!
</h1>
<img width="300" alt="Angular Logo" src="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyNTAgMjUwIj4KICAgIDxwYXRoIGZpbGw9IiNERDAwMzEiIGQ9Ik0xMjUgMzBMMzEuOSA2My4ybDE0LjIgMTIzLjFMMTI1IDIzMGw3OC45LTQzLjcgMTQuMi0xMjMuMXoiIC8+CiAgICA8cGF0aCBmaWxsPSIjQzMwMDJGIiBkPSJNMTI1IDMwdjIyLjItLjFWMjMwbDc4LjktNDMuNyAxNC4yLTEyMy4xTDEyNSAzMHoiIC8+CiAgICA8cGF0aCAgZmlsbD0iI0ZGRkZGRiIgZD0iTTEyNSA1Mi4xTDY2LjggMTgyLjZoMjEuN2wxMS43LTI5LjJoNDkuNGwxMS43IDI5LjJIMTgzTDEyNSA1Mi4xem0xNyA4My4zaC0zNGwxNy00MC45IDE3IDQwLjl6IiAvPgogIDwvc3ZnPg==">
</div>
<h2>Here are some links to help you start: </h2>
<ul>
<li>
<h2><a target="_blank" rel="noopener" href="https://angular.io/tutorial">Tour of Heroes</a></h2>