Giter Club home page Giter Club logo

monorepo's People

Contributors

adamtmhun avatar araknast avatar benjaminpreiss avatar christinabartozzi avatar danikvitek avatar doofin avatar emadbaqeri avatar felixhaeberle avatar flornkm avatar github-actions[bot] avatar hannes-oster avatar ivanhofer avatar janfjohannes avatar jannesblobel avatar jldec avatar leolurch avatar lorissigrist avatar lucidntr avatar martin-lysk avatar nc-nbc avatar niklasbuchfink avatar nilsjacobsen avatar normal-coder avatar openscript avatar s184186 avatar samuelstroschein avatar sebastianlj avatar thetarnav avatar warningimhack3r avatar zalamar avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

monorepo's Issues

get build command running for website

Describe the bug

Rollup polyfills for memfs seem to have a wrong setup. Development works, likely because vite uses esbuild for the dev server, while the build command, which uses rollup, fails.

'extname' is not exported by __vite-browser-external, imported by ../../node_modules/@rollup/pluginutils/dist/es/index.js
@inlang/website:build: file: /Users/samuel/Documents/GitHub.nosync/inlang/node_modules/@rollup/pluginutils/dist/es/index.js:1:9
@inlang/website:build: 1: import { extname, win32, posix, isAbsolute, resolve } from 'path';

To Reproduce
Steps to reproduce the behavior:

  1. run npm run build

Expected behavior

The build runs successfully.

Additional context
Add any other context about the problem here.

Language change on landing page

Describe the bug
I can't change the language on the Landing page.

To Reproduce
Steps to reproduce the behavior:

  1. Go to '.https://inlang.dev/'
  2. Scroll down
  3. Click on 'English'
  4. Click on 'Deutsch'
  5. The language did not change.

Expected behavior
A clear and concise description of what you expected to happen.

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • . iOS
  • Browser . chrome,]

rewrite of editor

The editor requires an overhaul due to architectural changes laid out in #127.

This issue's purpose is to define a feature set and track the corresponding progress on those features.

The following features are likely out of scope:

rewrite of the IDE extension

The IDE extension requires an overhaul due to architectural changes laid out in #127.

This issue's purpose is to define the minimum feature set and track the corresponding progress on those features.

Avoid network request to translate apps

Intro

The current implementation relies on Server Side Rendering (SSR) to fetch a JSON file over a network request which contains the translations. This has the severe downside of requiring a server-side framework like NextJS or SvelteKit for inlang to work. Furthermore, the security of fetching the translations is not rigid. Anyone can fetch any translations by using the domain of the app.

TLDR

  • relies on SSR, thus requiring special frameworks like NextJS, SvelteKit and a special SSR step e.g. using load() in svelteKit or getStaticProps in NextJS.
  • security risks that come with fetching translations via a network request

Proposal

The GitHub repo of a certain app can be used directly as "storage" for the translations. Using the source code directly eliminates the need to make a network request, thus the need for an SSR framework and potential security risks.

Pros

  • no network request, no SSR required(?)
  • no network request, less security issues
  • changing the translations in the source code without the need for a dashboard

Cons

  • No dynamic updating of translations. (Re-add network request as a feature in the future?). Important for Native Apps which must submit a new version of the app each time the translations should update.

Blog and documentation links don't work

Describe the bug
On the README, clicking Blog or documentation leads to a 404 on inlang.dev

To Reproduce
Steps to reproduce the behavior:

  1. Load Github readme2.
  2. Click blog or documentation

loadTranslations is not a function

I get the following error if I try to use inlang in my sveltekit project.

500
__vite_ssr_import_1__.loadTranslations is not a function
TypeError: __vite_ssr_import_1__.loadTranslations is not a function
    at load (__layout.svelte:9:38)
    at load_node (file:///Users/swelsch/Development/b-nova/breedium/frontend/node_modules/@sveltejs/kit/dist/ssr.js:957:30)
    at respond$1 (file:///Users/swelsch/Development/b-nova/breedium/frontend/node_modules/@sveltejs/kit/dist/ssr.js:1242:21)
    at async render_page (file:///Users/swelsch/Development/b-nova/breedium/frontend/node_modules/@sveltejs/kit/dist/ssr.js:1433:19)
    at async resolve (file:///Users/swelsch/Development/b-nova/breedium/frontend/node_modules/@sveltejs/kit/dist/ssr.js:1696:10)
    at async Object.handle (/Users/swelsch/Development/b-nova/breedium/frontend/src/hooks.ts:14:24)
    at async respond (file:///Users/swelsch/Development/b-nova/breedium/frontend/node_modules/@sveltejs/kit/dist/ssr.js:1675:10)
    at async svelteKitMiddleware (file:///Users/swelsch/Development/b-nova/breedium/frontend/node_modules/@sveltejs/kit/dist/chunks/index.js:4531:22)

I did npm install inlang --save and my __layout.svelte file looks like

<script lang="ts" context="module">
	import Header from '$lib/header/Header.svelte';

    import { setTranslations, loadTranslations } from 'inlang';

    export async function load({ page }) {
        if (page.params.lang) {
            setTranslations(
                await loadTranslations({
                    projectDomain: 'demo.sveltekit.inlang.dev',
                    locale: page.params.lang
                })
            );
        }
        return {};
    }
</script>

[dashboard] delete a language is not possible

Describe the bug
A clear and concise description of what the bug is.

**
To Reproduce**
Steps to reproduce the behavior:

  1. Go to languages
  2. Click on delete

Expected behavior
Deleting the language

Screenshots
Screenshot 2022-02-21 at 19 02 36

dropdown is buggy on website

Describe the bug

Icon mismatch/design bug when opening the dropdown in website-and-editor branch on the homepage.

image

file-based security

The editor clones a whole repository. Especially for private repositories, file-based access control is desired. A translator should only be able to clone translation relevant files.

Package `@inlang/cli` not found in the registry

Describe the bug
When trying to install the CLI via NPM, I get an error message that the package is not found.

To Reproduce
Steps to reproduce the behavior:

  1. Create a new folder
  2. Run npm init -y
  3. Run npm i @inlang/cli -D
  4. See error:
npm ERR! code E404
npm ERR! 404 Not Found - GET https://registry.npmjs.org/@inlang%2fcli - Not found
npm ERR! 404 
npm ERR! 404  '@inlang/cli@*' is not in this registry.
npm ERR! 404 You should bug the author to publish it (or use the name yourself!)
npm ERR! 404 
npm ERR! 404 Note that you can also install from a
npm ERR! 404 tarball, folder, http url, or git url.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/ben/.npm/_logs/2022-03-25T08_22_13_677Z-debug-0.log

Expected behavior
The package should be in the registry and install.

Desktop:

  • OS: MacOS
  • Node Version: v17.4.0

Document existing converters

This page says translations can be converted with converters when downloading formats other than fluent.

Is there any existing converter? I couldn't find info regarding existing options.

Or is that wip?

move source-code-configs out of source code,

Whats an enhancement?

Source-code-configs contains no source-code. Move config files out of the directory?

image


Describe the enhancement
A clear and concise description of what the enhancement is about.

Expected behavior
A clear and concise description of what you expected to happen.

Screenshots
If applicable, add screenshots to help explain your problem.

Additional context
Add any other context about the problem here.

fix node:fs/promises type for $fs

**Describe **

The defined subset of the node fs in the config is incompatible with node:fs/promises.

Expected behavior
Node's promise-based fs type should be compatible with the defined fs type in the config.

Screenshots
image

Additional context
Add any other context about the problem here.

[vs-code-extension] extracting pattern with variables

Extending on #103

Smart extraction of string interpolation:

Allow selecting `Hello, ${userName}` for extraction.
When extracting it should generate Hello, {$userName} in the ftl file. And in code it should pass userName as a parameter.

VS Code extension multi-root workspace support

The VS Code extension looks for the inlang.config.json file in the first workspace folder (and fails if it is not found there). This makes it difficult to use Inlang in a multi-root workspace if the repo using Inlang is not in the first workspace folder (requires moving or linking the config file to the first folder) and impossible to use Inlang with different configurations in different folders of a multi-root workspace.

Maybe:

https://github.com/inlang/inlang/blob/cf6c11e731909f508fc8b28ada2e6389b47d7212/packages/inlang-vscode-extension/src/extension.ts#L26

could be replaced with something like:

const openedDirectoryPath =  vscode.workspace.getWorkspaceFolder(vscode.window.activeTextEditor.document.uri).uri.fsPath;

which would look for the inlang.config.json file in the workspace folder that contains the file opened in the active text editor. That way each workspace folder in a multi-root workspace could have its own config file.

[dashboard] message search wrong patterns

Searching through the messages updates the rows, but not the underlying patterns. I assume that the patterns array is not filtered. Accessing a pattern with the row index likely leads to that issue i.e. patterns[index]

image

nav bar end editor needs better contrast between each other

Problem

The nav bar and editor seem visually too close. Both make use of a horizontal divider and no color difference between them.

image

Proposal

Increase visual difference by either changing the nav bar or the "editor nav bar". GitHub only uses color.

image

We could use surface-100 for the nav bar. I played around with surface-100, a bit too light. The hue likely needs to increase in the color system to make a meaningful difference.

preview message inline

This feature exists in the current vs code extension already but will be re-implemented in anticipation of the architectural changes laid out in #127.

image

contribute to foreign repositories via forks

Contributing via OAuth flows (see #136) does not work for external contributors or repositories a translator has no access to. An alternative for public repositories could be GitHub's fork functionality. The editor forks a public repository either on behalf of the user or by creating an inlang-fork/repository fork for all external contributors.

More ideas are welcome.

Self hosted dashboard?

Hello,

Since the files are all here, it would be nice to have a setup documentation for them. Better yet if you packed the dashboard components under a single docker-compose project.

inlang.config.json also needs a server host field

add index to query messages faster

looping over all bundles and their resources is a performance bottleneck

const messages = bundle.resources.flatMap((resource) => resource.body);
const message = messages.find((message) => message.id.name === args.id);

Instead, the query function could be created with a const query = createQuery() function that holds an index (hash table) of messages to speed up querying e.g. instead of looping through resources, a more efficient query would be

bundles[bundleId].resources[resourceId].messages[messageId]

https://github.com/inlang/inlang/blob/eb038be273e0a56e11eff97e153525a70ed4ae9e/source-code/core/src/query/index.ts#L99

extraction shortcut

This feature exists in the current vs code extension already but will be re-implemented in anticipation of the architectural changes laid out in #127.

extract-pattern

contribute translations via GitHub OAuth

The initial version of the inlang editor should use existing git auth workflows. In other words, use OAuth flows to act on the behalf of the user.

This implementation only requires the user to "login" with a git provider and et voila, the user can contribute.

Export translations as .ts file to enable static type safety

One of the big problems of i18n is no existent type safety. https://github.com/ivanhofer/typesafe-i18n is gaining momentum as one of the first solutions that enable typesafety for i18n. It requires setup and continuously watches the translation file to auto-generate type annotations.

Inlang currently posts missing translations via a network request. That is already better than most wide-stream i18n solutions but also has downsides:

  1. During development, the missing translations can become convoluted. A developer might wrote a typo "hrllo" instead of "hello" which the dev fixes after 1 min but it's too late "hrllo" and "hello" are posted and tracked as missing translations. One way to avoid that is using ids t('hrrlo', {id: 'compenent.hello'} .
  2. Even if id's are used, the translation for 'component.hello' might not exist yet. In other words the DX can be improved by showing a linting error that the translation key does not exist yet. And instead of baking a network request into the t function, a VSCode extension could do that job. I currently imagine the linting error, when hovering over the error a small popup from the inlang-vscode extension shows with a simple "add to translations" button.

Regardless of how missing translations are tracked. Typesafety is even better for variables t("Hello {user}", vars: { uset: "Samuel" }) is a runtime error. The type uset is not statically caught. Neither would be something like t("Hello {userId:number}", vars: {userId: "Samuel"}` userId is expected to be a number but a string is passed. As a matter of fact, that will not even be a runtime error.

TLDR

Exporting statically typed translation files into the source repository instead of json files can greatly improve DX.


Automatically created from Linear (#25)

via LinearSync

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.