Skip to content
This repository has been archived by the owner on Apr 18, 2023. It is now read-only.

Pod support #346

Closed
GabrielCW opened this issue Dec 30, 2015 · 6 comments
Closed

Pod support #346

GabrielCW opened this issue Dec 30, 2015 · 6 comments

Comments

@GabrielCW
Copy link

Hi there, I was wondering if there are any plans to support pods to load translations? It seems Ember is gonna support pods more and more, so it would be appreciated to have a way to dispatch translations in pods.

Is there a way to do this already? What would be missing to make it work?
The subject was touched in #255 but I haven't seen it discussed elsewhere.

Edit: there seems to be an addon doing that, but wouldn't it be useful to port this into ember-i18n?

@jamesarosen
Copy link
Owner

I have not given this any thought yet. Do you want to put together an RFC? Or maybe just list some requirements and try to raise some of the relevant questions? For example:

  • How does Ember-I18n find all of the translations modules?
  • If two pods have conflicting translations, which wins?

@briarsweetbriar
Copy link

You may have already seen this video, but pod structure will be changing considerably in the (ambiguously) near future. Might be worth holding off until the dust has settled there.

@jamesarosen
Copy link
Owner

Thanks for the tip! It will be several weeks before I pick up more ember-i18n work. I'll be sure to keep this in mind when I do 😀

@NullVoxPopuli
Copy link

NullVoxPopuli commented May 7, 2018

I'm testing out module unification atm,

had to change my resolver.js to look like this:

import Resolver from 'ember-resolver/resolvers/fallback';
// import Resolver from 'ember-resolver/resolvers/glimmer-wrapper';

import { merge } from '@ember/polyfills';


import buildResolverConfig from 'ember-resolver/ember-config';
import config from '../config/environment';

let moduleConfig = buildResolverConfig(config.modulePrefix);
/*
 * If your application has custom types and collections, modify moduleConfig here
 * to add support for them.
 */

 merge(moduleConfig.types, {
  config: { definitiveCollection: 'main' },
  locale: { definitiveCollection: 'main'},
  'ember-i18n@config': { definitiveCollection: 'main' },
  'util': { definitiveCollection: 'utils' },
});

moduleConfig.collections.main.types.push('config');

export default Resolver.extend({
  config: moduleConfig
});

can't find my translations yet (using typescript). more research ahead!

@NullVoxPopuli
Copy link

ok, I have translations kinda working... but it's a hack.

ember-i18n doesn't support the src (as opposed to app paths) paths that module unification is uses.

to remedy this for the short term, I did:

cd <project>
mkdir app/locales/en-us
cd app/locales/en-us
ln -s ../../../src/locales/en-us/translations.js transaltions.js

the location of my actual file is at <project>/src/locales/en-us/translations.js (I also changed the extension to js, because ts wasn't being picked up by ember-i18n (I probably just needed to tweak my tsconfig... but oh well - ember-i18n doesn't have types as for as I'm aware of anyway))

image

I have app .gitignored because with module unification, there should be nothing in the app directory (but it keeps getting added because generators aren't quite up to date yet.

here is my repo if you want to go poke around: https://github.com/NullVoxPopuli/emberclear

@jamesarosen
Copy link
Owner

jamesarosen/ember-i18n has been deprecated in favor of ember-intl.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants