globalize

Rails globalize + friendly id

别来无恙 提交于 2019-12-23 02:53:48
问题 I have a problem with globalize and friendly_id. The site has 2 languages Ru and En. Gem friendly_id, globalize and friendly_id-globalize configured and work. If I change the language from Russian to English, all is well: http://127.0.0.1:3000/ru/o-saite -> http://127.0.0.1:3000/en/about-site But when I change from English to Russian going wrong redirection: http://127.0.0.1:3000/en/about-site -> http://127.0.0.1:3000/ru/about-site page model: class Page < ActiveRecord::Base validates :title,

Dojo 国际化进阶

那年仲夏 提交于 2019-12-22 17:05:35
【推荐】2019 Java 开发者跳槽指南.pdf(吐血整理) >>> Dojo 官网: https://dojo.io 使用消息包 Dojo 的消息包概念是一个 Map 对象,其中存储用 key 标识的文本消息,每个 key 标识的消息内容可以用一到多种语言表示。 当需要向最终用户显示消息时,Dojo 应用程序使用 key 来引用该消息。这就避免了在代码中硬编码某一种语言的文本,而是提供了一门或多门语言的外部消息集,这些消息集能独立于应用程序的代码单独维护。 在渲染时,根据部件中引用消息 key 时的当前区域设置,Dojo 的 i18n 框架使用指定语言的文本内容替换掉消息 key。 Dojo 应用程序可以选择在整个应用程序中只使用一个消息包;也可以将消息进一步拆分的更细,接近于一个部件对应一个消息包,最终得到一个包含多个消息包的应用程序。 包的默认语言 每个消息包中都会包含多门语言的翻译。其中一门语言需要作为其余语言包的默认模块。这个默认的语言模块用于导入(或引用)包,主要实现两个需求: 提供一组完整的消息 key 及对应的内容(使用默认语言),如果包中的其他语言没有覆写某一个 key,则回退使用这些 key 和内容 列出包中支持的其他语言,以及每一个支持的语言模块消息集的加载机制 TypeScript 结构 包中的每一种语言都是一个 TypeScript 模块

Elasticsearch does not seem to be working as expected

霸气de小男生 提交于 2019-12-12 03:24:39
问题 I am using elasticsearch and globalize gems for full text searching and what I expect is that I can search for supplier name, localised description using czech/english analyzer. Example: Supplier Name: "Bonami.cz" Supplier Description_CZ: "Test description in czech." It works when I search for "Bonami.cz", but it does not work (0 results) when I search for: "Bonami" (part of the word) "test" (description) Based on documentation, the below methods should work, but apparently I have missed

Ransack search and translations

那年仲夏 提交于 2019-12-11 10:06:19
问题 I´m trying to make ransack work on a model that has an association with a translation table. Translations are managed by globalize gem. The problem is when I try to search with ransack in model table in :name column, it shows nothing because the :name information is stored in another table. Any clues how can I make ransack search in the association translation table? I know there is the possibility of using ransackers, but I have no idea which code to put in them. 回答1: Globalize gives you a

Redirect same page to different language with Globalize & Friendly_id

三世轮回 提交于 2019-12-07 01:07:10
问题 I've been scratching my head for the last few hours, looking for an answer but I can't find it anywhere. My gem file: # Use globalize for translating models gem "globalize", github: "ncri/globalize" # for Rails 4.2 gem 'globalize-accessors', '~> 0.1.5' # Use friendly_id for slugs gem 'friendly_id', '~> 5.1.0' gem 'friendly_id-globalize', '~> 1.0.0.alpha1' Here's the situation: I have two languages "en" and "fr" 2 models : pages and pages_translations pages has a slug column, pages

Redirect same page to different language with Globalize & Friendly_id

做~自己de王妃 提交于 2019-12-05 04:16:55
I've been scratching my head for the last few hours, looking for an answer but I can't find it anywhere. My gem file: # Use globalize for translating models gem "globalize", github: "ncri/globalize" # for Rails 4.2 gem 'globalize-accessors', '~> 0.1.5' # Use friendly_id for slugs gem 'friendly_id', '~> 5.1.0' gem 'friendly_id-globalize', '~> 1.0.0.alpha1' Here's the situation: I have two languages "en" and "fr" 2 models : pages and pages_translations pages has a slug column, pages_translations also has a slug column. if I view the page -> en/pages/slug-en, it works. if I view the page -> fr