Skip to content

GitLab

  • Menu
Projects Groups Snippets
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
  • C chouette-core-tmp
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 0
    • Issues 0
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 0
    • Merge requests 0
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Packages & Registries
    • Packages & Registries
    • Infrastructure Registry
  • Analytics
    • Analytics
    • CI/CD
    • Repository
    • Value Stream
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Administrator
  • chouette-core-tmp
  • Wiki
  • Rails I18n

Rails I18n · Changes

Page history
Created Rails I18n (markdown) authored Mar 30, 2018 by Luc Donnet's avatar Luc Donnet
Show whitespace changes
Inline Side-by-side
Showing with 13 additions and 0 deletions
+13 -0
  • Rails-I18n.md Rails-I18n.md +13 -0
  • No files found.
Rails-I18n.md 0 → 100644
View page @ 25d327e5
## Enables the following syntaxes in views, controllers and models :
|syntax|description|
|---|---|
|`"foo.bar".t`|equivalent to `I18n.t("foo.bar")`|
|`Catalog.t`|gets the human name of the `Catalog` model (plural by default)|
|`Catalog.ts`|gets the human name of the `Catalog` model (singular)|
|`Catalog.tmf('name')`|gets the human name of the `Catalog` model's `name` attribute|
|`Catalog.t_action('new)`|gets the human name of the `Catalog` model's `new` action label (fallbacks on generic action labels)|
Furthermore, all these methods get the following features:
- fallback on the `default` key: if the lookup for `foo.bar.baz.bat` is unsucessful, we'll look for `foo.bar.default.bat`, then `foo.default.bat`, etc.
- missing keys display + logging: __in development mode__, missing keys are signaled in the UI and logged in `log/missing_keys.log`
Clone repository
  • Class Diagram
  • Data Models
  • Home
  • Optional Features
  • Rails Controller
  • Rails I18n
  • Rails migrations
  • Rails models
  • Rails spec
  • Rails views
  • Seed database