Comments (2)
You should be able to get the type of t
or scopedT
like this:
type T = ReturnType<typeof useI18n>['t']
But I'm not sure how that would play with scopedT
. The easiest way might be to use international-types directly, something like:
// Locale is the type of your locale, same when using createI18n
// 'table' is the scope
export const buildHeadIncidents = (t: (key: LocaleKeys<typeof Locale, 'table'>) => string): HeadCellItem[] => {
return [
{
name: 'title1',
label: t('mykey'),
},
{
name: 'title2',
label: t('mykey'),
},
{
name: 'title3',
label: t('mykey'),
}
];
};
from next-international.
Amazing thank you so much ๐
from next-international.
Related Issues (20)
- [Feature] Direction Provider
- Default locale not added on redirect
- import_server is not defined
- How to enable SSR for pages dir? (pageProps.locale is undefined during SSR rendering) HOT 3
- Using Cloudflare Pages forgets the selected language HOT 2
- Is there any way to adopt i18n without sub-path routing on Pages Router?
- Question: Is there feature for use translate outside hook and component? HOT 2
- [SSG][Metadata] AlternateURLs/Languages ; OpenGraphMetadata
- Failed to execute 'removeChild' on 'Node' when using `useChangeLocale` and `useCurrentLocale`
- is there ignoreRoutes property for ignore adding localization route to static file HOT 1
- Feedback for โSetupโ HOT 1
- [Question][Maybe due to the middleware] Forced `canonical` on OpenGraph? HOT 1
- Display Loading Indicator During Language Translation Process HOT 1
- Unit testing with createI18nServer in server-side components throws server-only error HOT 1
- Automatically localize from middleware HOT 1
- Feedback for โGet Startedโ HOT 2
- Can't set an empty string as translation value for a key
- Bailout to client side rendering HOT 1
- setStaticParamsLocale in root layout.tsx
- Migration to App router | Documentation
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from next-international.