sanichkotikov / solid-i18n Goto Github PK
View Code? Open in Web Editor NEWTiny internationalization library for SolidJS.
Home Page: https://sanichkotikov.github.io/solid-i18n-example/
License: MIT License
Tiny internationalization library for SolidJS.
Home Page: https://sanichkotikov.github.io/solid-i18n-example/
License: MIT License
Hello,
I'm new to SolidJS so maybe I'm doing something wrong (but I didn't do much!). Trying to use this library by following the basic example :
import { createI18n, I18nProvider, Text } from 'solid-i18n';
const i18n = createI18n({ language: 'en' });
function App() {
return (
<I18nProvider i18n={i18n}>
<Text
message="Read the <link>documentation</link> for more info."
link={(text) => <a href="https://github.com/SanichKotikov/solid-i18n">{text}</a>}
/>
</I18nProvider>
)
}
I created a new SolidStart project (just the bare template) and added solid-i18n. Then I wrapped the in the root with the I18Provider just like in the example. Even without adding a element I am getting this error:
An unhandler error occured: SyntaxError: Cannot use import statement outside a module
Also, when I start the project, the following warning appears in the console:
solid-i18n doesn't appear to be written in CJS, but also doesn't appear to be a valid ES module (i.e. it doesn't have "type": "module" or an .mjs extension for the entry point). Please contact the package author to fix.
Maybe the problem is related to this?
Based on the discussion we had in my recent Pull Request, I would like to suggest adding Prettier to the project. Prettier is an opinionated code formatter that can help maintain a consistent code style and improve readability.
By using Prettier, we can save time and effort in code reviews by automatically formatting our code according to a set of rules. This will also help us avoid unnecessary discussions about code style and focus on more important aspects of the code.
I believe that adding Prettier to the project will be beneficial for all contributors and I would love to hear your thoughts on this.
I noticed that some of the headings in the document are not following the MD001/heading-increment/header-increment
rule. This rule states that heading levels should only increment by one level at a time, for example, from H2
to H3
, instead of H4
. This helps to maintain a clear and consistent structure of the document.
The following lines have headings that violate this rule:
H2
H4
I suggest changing the H4
headings to H3
headings to comply with the rule. Alternatively, you can add intermediate H3
headings between the H2
and H4
headings to create a logical hierarchy.
I noticed that the components
folder does not have an index.ts
file that exports all the components. This makes importing them in other files more tedious and verbose. I suggest adding an index.ts
file to the components folder that exports all the components.
Then, we can refactor the libraries index.ts
file to import from the components folder instead of each individual component file, like this:
export * from './components';
This will simplify the imports and make the code more consistent and maintainable. What do you think?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.