Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ENGAGE-1605] - Add missing i18n translations #150

Merged
merged 8 commits into from
Sep 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 13 additions & 3 deletions .github/workflows/test-and-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,23 +6,33 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Setup Node 18
uses: actions/setup-node@v2
with:
node-version: '18'

- name: Install system dependencies for canvas
run: sudo apt-get install -y libcairo2-dev libjpeg-dev libpango1.0-dev libgif-dev build-essential g++

- name: Install dependencies
run: |
npm install -g yarn
yarn install
npm install -g yarn
yarn install

- name: Run build translations
run: yarn translations:build

- name: Run lint
run: yarn lint

- name: Run tests and coverage
run: yarn test:coverage

- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v4.0.1
with:
token: ${{ secrets.CODECOV_TOKEN }}

- name: Build application
run: yarn build
run: yarn build
8 changes: 8 additions & 0 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,14 @@ ENV VITE_HOTJAR_ID $VITE_HOTJAR_ID

RUN apk --no-cache add git

RUN apk add --no-cache \
build-base \
cairo-dev \
pango-dev \
jpeg-dev \
giflib-dev \
librsvg-dev

COPY package.json yarn.lock ./

RUN --mount=type=cache,target=/root/.yarn \
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
"@vue/eslint-config-prettier": "^8.0.0",
"@vue/test-utils": "^2.4.6",
"@weni/eslint-config": "^1.0.3",
"canvas": "^2.11.2",
"canvas": "^2.10.0",
"eslint": "^7.0.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-prettier": "^5.0.0",
Expand All @@ -56,4 +56,4 @@
"resolutions": {
"strip-ansi": "6.0.1"
}
}
}
2 changes: 1 addition & 1 deletion src/components/insights/Layout/Header.vue
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ export default {
crumbs[1] = {
path: this.$route.path,
routePath: 'report',
name: `Relatório ${currentDashboard.name}`,
name: `${this.$t('report')} ${currentDashboard.name}`,
};
}

Expand Down
2 changes: 1 addition & 1 deletion src/components/insights/Layout/HeaderFilters/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
v-if="appliedFiltersLength > 0"
type="tertiary"
iconLeft="close"
text="Limpar"
:text="$t('insights_header.clear_filters')"
@click.stop="clearFilters"
/>
</template>
Expand Down
2 changes: 1 addition & 1 deletion src/components/insights/PromptsHistory/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
class="prompts-history__conversation"
>
<PromptHistoryMessage
title="Você:"
:title="`${$t('you')}:`"
:content="insight.request"
/>
<PromptHistoryMessage
Expand Down
10 changes: 10 additions & 0 deletions src/locales/translations.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,16 @@
"en": "Select",
"es": "Seleccionar"
},
"report": {
"pt-br": "Relatório",
"en": "Report",
"es": "Informe"
},
"you": {
"pt-br": "Você",
"en": "You",
"es": "Usted"
},
"none": {
"pt-br": "Nenhum",
"en": "None",
Expand Down
39 changes: 1 addition & 38 deletions vite.config.js
Original file line number Diff line number Diff line change
@@ -1,35 +1,12 @@
import { fileURLToPath, URL } from 'node:url';
import { createHash } from 'crypto';
import fs from 'fs';
import path from 'path';

import { defineConfig } from 'vite';
import vue from '@vitejs/plugin-vue';
import vueJsx from '@vitejs/plugin-vue-jsx';

const htmlTransform = () => ({
name: 'html-transform',
apply: 'build',
closeBundle() {
const indexPath = path.resolve(__dirname, 'dist', 'index.html');

const hash = createHash('md5')
.update(Date.now().toString())
.digest('hex')
.substring(0, 8);

let html = fs.readFileSync(indexPath, 'utf-8');

// Added the query string ?v=[hash] for CSS and JS only
html = html.replace(/(\/assets\/insights\.(js|css))/g, `$1?v=${hash}`);

fs.writeFileSync(indexPath, html);
},
});

// https://vitejs.dev/config/
export default defineConfig({
plugins: [vue(), vueJsx(), htmlTransform()],
plugins: [vue(), vueJsx()],
css: {
preprocessorOptions: {
scss: {
Expand All @@ -44,18 +21,4 @@ export default defineConfig({
'@': fileURLToPath(new URL('./src', import.meta.url)),
},
},
build: {
rollupOptions: {
output: {
entryFileNames: 'assets/insights.js',
chunkFileNames: 'assets/insights.js',
assetFileNames: (assetInfo) => {
if (assetInfo.name.endsWith('.css')) {
return 'assets/insights.css';
}
return 'assets/' + assetInfo.name;
},
},
},
},
});
2 changes: 1 addition & 1 deletion yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1735,7 +1735,7 @@ caniuse-lite@^1.0.30001646:
resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001651.tgz#52de59529e8b02b1aedcaaf5c05d9e23c0c28138"
integrity sha512-9Cf+Xv1jJNe1xPZLGuUXLNkE1BoDkqRqYyFJ9TDYSqhduqA4hu4oR9HluGoWYQC/aj8WHjsGVV+bwkh0+tegRg==

canvas@^2.11.2:
canvas@^2.10.0:
version "2.11.2"
resolved "https://registry.yarnpkg.com/canvas/-/canvas-2.11.2.tgz#553d87b1e0228c7ac0fc72887c3adbac4abbd860"
integrity sha512-ItanGBMrmRV7Py2Z+Xhs7cT+FNt5K0vPL4p9EZ/UX/Mu7hFbkxSjKF2KVtPwX7UYWp7dRKnrTvReflgrItJbdw==
Expand Down
Loading