brut 0.0.21 → 0.0.22
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.gitignore +24 -3
- data/.nvim.lua +1 -0
- data/Dockerfile.dx +12 -3
- data/Gemfile.lock +9 -7
- data/README.md +0 -7
- data/Rakefile +6 -4
- data/bin/dev +20 -0
- data/bin/docs +27 -0
- data/bin/setup +47 -1
- data/brut-css/.nvim.lua +1 -0
- data/brut-css/README.md +28 -0
- data/brut-css/bin/build +31 -0
- data/brut-css/bin/dev +1 -0
- data/brut-css/bin/docs +15 -0
- data/brut-css/bin/setup +5 -0
- data/brut-css/config/media-queries-all.css +15 -0
- data/brut-css/config/media-queries-minimal.css +5 -0
- data/brut-css/config/postcss.config.cjs +7 -0
- data/brut-css/config/pseudo-classes-all.css +9 -0
- data/brut-css/dx +1 -0
- data/brut-css/package-lock.json +3217 -0
- data/brut-css/package.json +36 -0
- data/brut-css/src/css/appearance.css +145 -0
- data/brut-css/src/css/border.css +522 -0
- data/brut-css/src/css/colors.css +3502 -0
- data/brut-css/src/css/dimensions.css +548 -0
- data/brut-css/src/css/flex.css +179 -0
- data/brut-css/src/css/index.css +13 -0
- data/brut-css/src/css/layout.css +120 -0
- data/brut-css/src/css/list.css +41 -0
- data/brut-css/src/css/positioning.css +354 -0
- data/brut-css/src/css/properties/colors.css +455 -0
- data/brut-css/src/css/properties/index.css +3 -0
- data/brut-css/src/css/properties/spacing.css +140 -0
- data/brut-css/src/css/properties/typography.css +224 -0
- data/brut-css/src/css/reset.css +107 -0
- data/brut-css/src/css/spacing.css +585 -0
- data/brut-css/src/css/typography.css +519 -0
- data/brut-css/src/css/utils.css +104 -0
- data/brut-css/src/docs/1_getting-started/1_overview.md +46 -0
- data/brut-css/src/docs/1_getting-started/2_installation.md +25 -0
- data/brut-css/src/docs/1_getting-started/3_core-concepts.md +75 -0
- data/brut-css/src/docs/1_getting-started/4_simple-example.md +132 -0
- data/brut-css/src/docs/1_getting-started/page.html.ejs +10 -0
- data/brut-css/src/docs/2_properties/page.html.ejs +71 -0
- data/brut-css/src/docs/3_classes/color-demo.html.ejs +31 -0
- data/brut-css/src/docs/3_classes/page.html.ejs +87 -0
- data/brut-css/src/docs/4_customization/1_design-system.md +36 -0
- data/brut-css/src/docs/4_customization/2_breakpoints.md +75 -0
- data/brut-css/src/docs/4_customization/3_pseudo-classes.md +74 -0
- data/brut-css/src/docs/4_customization/4_advanced-configuration.md +40 -0
- data/brut-css/src/docs/4_customization/page.html.ejs +10 -0
- data/brut-css/src/docs/docs.css +98 -0
- data/brut-css/src/docs/includes/body-and-header.html.ejs +30 -0
- data/brut-css/src/docs/includes/footer-and-rest.html.ejs +9 -0
- data/brut-css/src/docs/includes/head.html.ejs +5 -0
- data/brut-css/src/docs/includes/nav.html.ejs +10 -0
- data/brut-css/src/docs/index.html.ejs +32 -0
- data/brut-css/src/docs/prism-twilight.min.css +1 -0
- data/brut-css/src/js/Logger.js +71 -0
- data/brut-css/src/js/build.js +111 -0
- data/brut-css/src/js/cli/CLIArgError.js +7 -0
- data/brut-css/src/js/cli/Debug.js +27 -0
- data/brut-css/src/js/cli/DocsDir.js +16 -0
- data/brut-css/src/js/cli/DocsTemplateSourceDir.js +16 -0
- data/brut-css/src/js/cli/InputFile.js +31 -0
- data/brut-css/src/js/cli/MediaQueryConfigFile.js +10 -0
- data/brut-css/src/js/cli/OutputFile.js +22 -0
- data/brut-css/src/js/cli/ParsedArg.js +17 -0
- data/brut-css/src/js/cli/PathToBrutCSSRoot.js +19 -0
- data/brut-css/src/js/cli/PseudoClassConfigFile.js +11 -0
- data/brut-css/src/js/cli.js +108 -0
- data/brut-css/src/js/docGenerator.js +467 -0
- data/brut-css/src/js/mediaQueryConfigParser.js +98 -0
- data/brut-css/src/js/post-css-plugins/addMediaQueriesPlugin.js +49 -0
- data/brut-css/src/js/post-css-plugins/addPseudoClassesPlugin.js +42 -0
- data/brut-css/src/js/post-css-plugins/generateDocumentationPlugin/Category.js +9 -0
- data/brut-css/src/js/post-css-plugins/generateDocumentationPlugin/DocState.js +185 -0
- data/brut-css/src/js/post-css-plugins/generateDocumentationPlugin/Documentable.js +8 -0
- data/brut-css/src/js/post-css-plugins/generateDocumentationPlugin/Group.js +7 -0
- data/brut-css/src/js/post-css-plugins/generateDocumentationPlugin/ParsedComment.js +73 -0
- data/brut-css/src/js/post-css-plugins/generateDocumentationPlugin/Property.js +9 -0
- data/brut-css/src/js/post-css-plugins/generateDocumentationPlugin/PropertyCategory.js +4 -0
- data/brut-css/src/js/post-css-plugins/generateDocumentationPlugin/PropertyGroup.js +8 -0
- data/brut-css/src/js/post-css-plugins/generateDocumentationPlugin/Rule.js +12 -0
- data/brut-css/src/js/post-css-plugins/generateDocumentationPlugin/RuleCategory.js +4 -0
- data/brut-css/src/js/post-css-plugins/generateDocumentationPlugin/RuleGroup.js +8 -0
- data/brut-css/src/js/post-css-plugins/generateDocumentationPlugin/SeeRef.js +5 -0
- data/brut-css/src/js/post-css-plugins/generateDocumentationPlugin/SeeURL.js +9 -0
- data/brut-css/src/js/post-css-plugins/generateDocumentationPlugin.js +49 -0
- data/brut-css/src/js/post-css-plugins/generateRootCustomPropertiesPlugin.js +45 -0
- data/brut-css/src/js/pseudoClassConfigParser.js +145 -0
- data/brut-js/.projections.json +10 -0
- data/brut-js/README.md +118 -0
- data/brut-js/bin/build +10 -0
- data/brut-js/bin/ci +5 -0
- data/brut-js/bin/setup +5 -0
- data/brut-js/docs/README.md +8 -0
- data/brut-js/docs/jsdoc-plugins/customElementTag.js +8 -0
- data/brut-js/docs/jsdoc-theme/publish.js +692 -0
- data/brut-js/docs/jsdoc-theme/static/scripts/linenumber.js +25 -0
- data/brut-js/docs/jsdoc-theme/static/scripts/prettify/Apache-License-2.0.txt +202 -0
- data/brut-js/docs/jsdoc-theme/static/scripts/prettify/lang-css.js +2 -0
- data/brut-js/docs/jsdoc-theme/static/scripts/prettify/prettify.js +28 -0
- data/brut-js/docs/jsdoc-theme/static/styles/jsdoc-default.css +327 -0
- data/brut-js/docs/jsdoc-theme/static/styles/prettify-jsdoc.css +111 -0
- data/brut-js/docs/jsdoc-theme/static/styles/prettify-tomorrow.css +132 -0
- data/brut-js/docs/jsdoc-theme/tmpl/augments.tmpl +10 -0
- data/brut-js/docs/jsdoc-theme/tmpl/container.tmpl +199 -0
- data/brut-js/docs/jsdoc-theme/tmpl/details.tmpl +143 -0
- data/brut-js/docs/jsdoc-theme/tmpl/example.tmpl +2 -0
- data/brut-js/docs/jsdoc-theme/tmpl/examples.tmpl +13 -0
- data/brut-js/docs/jsdoc-theme/tmpl/exceptions.tmpl +32 -0
- data/brut-js/docs/jsdoc-theme/tmpl/layout.tmpl +38 -0
- data/brut-js/docs/jsdoc-theme/tmpl/mainpage.tmpl +14 -0
- data/brut-js/docs/jsdoc-theme/tmpl/members.tmpl +38 -0
- data/brut-js/docs/jsdoc-theme/tmpl/method.tmpl +131 -0
- data/brut-js/docs/jsdoc-theme/tmpl/modifies.tmpl +14 -0
- data/brut-js/docs/jsdoc-theme/tmpl/params.tmpl +131 -0
- data/brut-js/docs/jsdoc-theme/tmpl/properties.tmpl +108 -0
- data/brut-js/docs/jsdoc-theme/tmpl/returns.tmpl +19 -0
- data/brut-js/docs/jsdoc-theme/tmpl/source.tmpl +8 -0
- data/brut-js/docs/jsdoc-theme/tmpl/tutorial.tmpl +19 -0
- data/brut-js/docs/jsdoc-theme/tmpl/type.tmpl +7 -0
- data/brut-js/docs/jsdoc.config.json +23 -0
- data/brut-js/docs/package-lock.json +343 -0
- data/brut-js/docs/package.json +7 -0
- data/brut-js/package-lock.json +2171 -0
- data/brut-js/package.json +32 -0
- data/brut-js/specs/AjaxSubmit.spec.js +256 -0
- data/brut-js/specs/Autosubmit.spec.js +127 -0
- data/brut-js/specs/ConfirmSubmit.spec.js +193 -0
- data/brut-js/specs/ConstraintViolationMessage.spec.js +33 -0
- data/brut-js/specs/ConstraintViolationMessages.spec.js +29 -0
- data/brut-js/specs/CopyToClipboard.spec.js +35 -0
- data/brut-js/specs/Form.spec.js +181 -0
- data/brut-js/specs/I18nTranslation.spec.js +19 -0
- data/brut-js/specs/LocaleDetection.spec.js +22 -0
- data/brut-js/specs/Message.spec.js +15 -0
- data/brut-js/specs/SpecHelper.js +23 -0
- data/brut-js/specs/Tabs.spec.js +41 -0
- data/brut-js/specs/config/asset_metadata.json +7 -0
- data/brut-js/src/AjaxSubmit.js +384 -0
- data/brut-js/src/Autosubmit.js +63 -0
- data/brut-js/src/BaseCustomElement.js +261 -0
- data/brut-js/src/ConfirmSubmit.js +116 -0
- data/brut-js/src/ConfirmationDialog.js +143 -0
- data/brut-js/src/ConstraintViolationMessage.js +125 -0
- data/brut-js/src/ConstraintViolationMessages.js +98 -0
- data/brut-js/src/CopyToClipboard.js +96 -0
- data/brut-js/src/Form.js +151 -0
- data/brut-js/src/I18nTranslation.js +61 -0
- data/brut-js/src/LocaleDetection.js +117 -0
- data/brut-js/src/Logger.js +90 -0
- data/brut-js/src/Message.js +56 -0
- data/brut-js/src/RichString.js +113 -0
- data/brut-js/src/Tabs.js +168 -0
- data/brut-js/src/Tracing.js +247 -0
- data/brut-js/src/appForTestingOnly.js +15 -0
- data/brut-js/src/index.js +130 -0
- data/brut-js/src/testing/AssetMetadata.js +35 -0
- data/brut-js/src/testing/AssetMetadataLoader.js +25 -0
- data/brut-js/src/testing/CustomElementTest.js +235 -0
- data/brut-js/src/testing/DOMCreator.js +45 -0
- data/brut-js/src/testing/index.js +48 -0
- data/brutrb.com/.vitepress/config.mjs +106 -0
- data/brutrb.com/.vitepress/plugins/jsdocLinker.js +34 -0
- data/brutrb.com/.vitepress/plugins/rdocLinker.js +18 -0
- data/brutrb.com/.vitepress/theme/custom.css +7 -0
- data/brutrb.com/.vitepress/theme/index.js +18 -0
- data/brutrb.com/.vitepress/theme/style.css +149 -0
- data/brutrb.com/ai.md +68 -0
- data/brutrb.com/assets.md +138 -0
- data/brutrb.com/bin/build +5 -0
- data/brutrb.com/bin/deploy +7 -0
- data/brutrb.com/bin/dev +5 -0
- data/brutrb.com/bin/setup +5 -0
- data/brutrb.com/brut-js.md +117 -0
- data/brutrb.com/business-logic.md +55 -0
- data/brutrb.com/cli.md +278 -0
- data/brutrb.com/components.md +243 -0
- data/brutrb.com/configuration.md +257 -0
- data/brutrb.com/css.md +103 -0
- data/brutrb.com/custom-element-tests.md +149 -0
- data/brutrb.com/database-access.md +201 -0
- data/brutrb.com/database-schema.md +312 -0
- data/brutrb.com/deployment.md +66 -0
- data/brutrb.com/dev-environment.md +179 -0
- data/brutrb.com/doc-conventions.md +39 -0
- data/brutrb.com/end-to-end-tests.md +174 -0
- data/brutrb.com/flash-and-session.md +224 -0
- data/brutrb.com/forms.md +866 -0
- data/brutrb.com/getting-started.md +66 -0
- data/brutrb.com/handlers.md +153 -0
- data/brutrb.com/hooks.md +178 -0
- data/brutrb.com/i18n.md +188 -0
- data/brutrb.com/images/Makefile +10 -0
- data/brutrb.com/images/dev-env-overview.dot +54 -0
- data/brutrb.com/images/dev-env-overview.png +0 -0
- data/brutrb.com/images/dev-env-protocol.dot +37 -0
- data/brutrb.com/images/dev-env-protocol.png +0 -0
- data/brutrb.com/images/logo-300.png +0 -0
- data/brutrb.com/images/logo.png +0 -0
- data/brutrb.com/images/overview.graffle +0 -0
- data/brutrb.com/images/overview.png +0 -0
- data/brutrb.com/images/spa.dot +19 -0
- data/brutrb.com/images/spa.png +0 -0
- data/brutrb.com/images/workspace-protocol.dot +44 -0
- data/brutrb.com/images/workspace-protocol.png +0 -0
- data/brutrb.com/index.md +36 -0
- data/brutrb.com/instrumentation.md +183 -0
- data/brutrb.com/javascript.md +122 -0
- data/brutrb.com/jobs.md +14 -0
- data/brutrb.com/keyword-injection.md +237 -0
- data/brutrb.com/markdown-examples.md +85 -0
- data/brutrb.com/middleware.md +80 -0
- data/brutrb.com/not-released.md +5 -0
- data/brutrb.com/overview.md +404 -0
- data/brutrb.com/package-lock.json +2404 -0
- data/brutrb.com/package.json +11 -0
- data/brutrb.com/pages.md +378 -0
- data/brutrb.com/public/images/logo-300.png +0 -0
- data/brutrb.com/public/images/logo.png +0 -0
- data/brutrb.com/routes.md +215 -0
- data/brutrb.com/security.md +105 -0
- data/brutrb.com/seed-data.md +63 -0
- data/brutrb.com/space-time-continuum.md +85 -0
- data/brutrb.com/tutorial.md +3 -0
- data/brutrb.com/unit-tests.md +148 -0
- data/docker-compose.dx.yml +6 -3
- data/docs/404.html +21 -0
- data/docs/CNAME +1 -0
- data/docs/ai.html +24 -0
- data/docs/api/Brut/BackEnd/SeedData.html +493 -0
- data/docs/api/Brut/BackEnd/Sidekiq/Middlewares/Server/FlushSpans.html +214 -0
- data/docs/api/Brut/BackEnd/Sidekiq/Middlewares/Server.html +125 -0
- data/docs/api/Brut/BackEnd/Sidekiq/Middlewares.html +125 -0
- data/docs/api/Brut/BackEnd/Sidekiq.html +125 -0
- data/docs/api/Brut/BackEnd/Validators/FormValidator.html +414 -0
- data/docs/api/Brut/BackEnd/Validators.html +128 -0
- data/docs/api/Brut/BackEnd.html +132 -0
- data/docs/api/Brut/CLI/App.html +1576 -0
- data/docs/api/Brut/CLI/AppRunner.html +491 -0
- data/docs/api/Brut/CLI/Apps/BuildAssets/All.html +264 -0
- data/docs/api/Brut/CLI/Apps/BuildAssets/CSS.html +306 -0
- data/docs/api/Brut/CLI/Apps/BuildAssets/Images.html +262 -0
- data/docs/api/Brut/CLI/Apps/BuildAssets/JS.html +314 -0
- data/docs/api/Brut/CLI/Apps/BuildAssets.html +183 -0
- data/docs/api/Brut/CLI/Apps/DB/Create.html +365 -0
- data/docs/api/Brut/CLI/Apps/DB/Drop.html +357 -0
- data/docs/api/Brut/CLI/Apps/DB/Migrate.html +383 -0
- data/docs/api/Brut/CLI/Apps/DB/NewMigration.html +335 -0
- data/docs/api/Brut/CLI/Apps/DB/Rebuild.html +329 -0
- data/docs/api/Brut/CLI/Apps/DB/Seed.html +347 -0
- data/docs/api/Brut/CLI/Apps/DB/Status.html +383 -0
- data/docs/api/Brut/CLI/Apps/DB.html +183 -0
- data/docs/api/Brut/CLI/Apps/Scaffold/Action/Route.html +303 -0
- data/docs/api/Brut/CLI/Apps/Scaffold/Action.html +512 -0
- data/docs/api/Brut/CLI/Apps/Scaffold/Component.html +398 -0
- data/docs/api/Brut/CLI/Apps/Scaffold/CustomElementTest.html +374 -0
- data/docs/api/Brut/CLI/Apps/Scaffold/E2ETest.html +410 -0
- data/docs/api/Brut/CLI/Apps/Scaffold/Form.html +262 -0
- data/docs/api/Brut/CLI/Apps/Scaffold/Page/Route.html +303 -0
- data/docs/api/Brut/CLI/Apps/Scaffold/Page.html +480 -0
- data/docs/api/Brut/CLI/Apps/Scaffold/RoutesEditor.html +450 -0
- data/docs/api/Brut/CLI/Apps/Scaffold/Test.html +380 -0
- data/docs/api/Brut/CLI/Apps/Scaffold.html +253 -0
- data/docs/api/Brut/CLI/Apps/Test/Audit.html +464 -0
- data/docs/api/Brut/CLI/Apps/Test/E2e.html +407 -0
- data/docs/api/Brut/CLI/Apps/Test/JS.html +262 -0
- data/docs/api/Brut/CLI/Apps/Test/Run.html +578 -0
- data/docs/api/Brut/CLI/Apps/Test.html +253 -0
- data/docs/api/Brut/CLI/Apps.html +125 -0
- data/docs/api/Brut/CLI/Command.html +2342 -0
- data/docs/api/Brut/CLI/Error.html +139 -0
- data/docs/api/Brut/CLI/ExecutionResults/Result.html +664 -0
- data/docs/api/Brut/CLI/ExecutionResults.html +675 -0
- data/docs/api/Brut/CLI/Executor.html +430 -0
- data/docs/api/Brut/CLI/InvalidOption.html +245 -0
- data/docs/api/Brut/CLI/Options.html +753 -0
- data/docs/api/Brut/CLI/Output.html +699 -0
- data/docs/api/Brut/CLI/SystemExecError.html +451 -0
- data/docs/api/Brut/CLI.html +263 -0
- data/docs/api/Brut/FactoryBot.html +225 -0
- data/docs/api/Brut/Framework/App.html +1097 -0
- data/docs/api/Brut/Framework/Config.html +1045 -0
- data/docs/api/Brut/Framework/Container.html +1379 -0
- data/docs/api/Brut/Framework/Error.html +140 -0
- data/docs/api/Brut/Framework/Errors/AbstractMethod.html +144 -0
- data/docs/api/Brut/Framework/Errors/Bug.html +234 -0
- data/docs/api/Brut/Framework/Errors/MissingConfiguration.html +257 -0
- data/docs/api/Brut/Framework/Errors/MissingParameter.html +273 -0
- data/docs/api/Brut/Framework/Errors/NoClassForPath.html +471 -0
- data/docs/api/Brut/Framework/Errors/NotFound.html +308 -0
- data/docs/api/Brut/Framework/Errors/NotImplemented.html +234 -0
- data/docs/api/Brut/Framework/Errors.html +328 -0
- data/docs/api/Brut/Framework/FussyTypeEnforcement.html +392 -0
- data/docs/api/Brut/Framework/MCP.html +861 -0
- data/docs/api/Brut/Framework/ProjectEnvironment.html +648 -0
- data/docs/api/Brut/Framework.html +129 -0
- data/docs/api/Brut/FrontEnd/AssetPathResolver.html +317 -0
- data/docs/api/Brut/FrontEnd/Component/Helpers.html +326 -0
- data/docs/api/Brut/FrontEnd/Component.html +365 -0
- data/docs/api/Brut/FrontEnd/Components/ConstraintViolations.html +470 -0
- data/docs/api/Brut/FrontEnd/Components/FormTag.html +518 -0
- data/docs/api/Brut/FrontEnd/Components/I18nTranslations.html +317 -0
- data/docs/api/Brut/FrontEnd/Components/Input.html +195 -0
- data/docs/api/Brut/FrontEnd/Components/Inputs/CsrfToken.html +339 -0
- data/docs/api/Brut/FrontEnd/Components/Inputs/InputTag.html +660 -0
- data/docs/api/Brut/FrontEnd/Components/Inputs/RadioButton.html +417 -0
- data/docs/api/Brut/FrontEnd/Components/Inputs/SelectTagWithOptions.html +918 -0
- data/docs/api/Brut/FrontEnd/Components/Inputs/TextareaTag.html +651 -0
- data/docs/api/Brut/FrontEnd/Components/Inputs.html +125 -0
- data/docs/api/Brut/FrontEnd/Components/LocaleDetection.html +367 -0
- data/docs/api/Brut/FrontEnd/Components/PageIdentifier.html +336 -0
- data/docs/api/Brut/FrontEnd/Components/TimeTag.html +655 -0
- data/docs/api/Brut/FrontEnd/Components/Traceparent.html +352 -0
- data/docs/api/Brut/FrontEnd/Components.html +135 -0
- data/docs/api/Brut/FrontEnd/Download.html +467 -0
- data/docs/api/Brut/FrontEnd/Flash.html +1150 -0
- data/docs/api/Brut/FrontEnd/Form.html +1157 -0
- data/docs/api/Brut/FrontEnd/Forms/ConstraintViolation.html +634 -0
- data/docs/api/Brut/FrontEnd/Forms/Input.html +615 -0
- data/docs/api/Brut/FrontEnd/Forms/InputDeclarations.html +547 -0
- data/docs/api/Brut/FrontEnd/Forms/InputDefinition.html +1318 -0
- data/docs/api/Brut/FrontEnd/Forms/RadioButtonGroupInput.html +609 -0
- data/docs/api/Brut/FrontEnd/Forms/RadioButtonGroupInputDefinition.html +587 -0
- data/docs/api/Brut/FrontEnd/Forms/SelectInput.html +613 -0
- data/docs/api/Brut/FrontEnd/Forms/SelectInputDefinition.html +582 -0
- data/docs/api/Brut/FrontEnd/Forms/ValidityState.html +609 -0
- data/docs/api/Brut/FrontEnd/Forms.html +127 -0
- data/docs/api/Brut/FrontEnd/GenericResponse.html +377 -0
- data/docs/api/Brut/FrontEnd/Handler.html +442 -0
- data/docs/api/Brut/FrontEnd/Handlers/CspReportingHandler.html +318 -0
- data/docs/api/Brut/FrontEnd/Handlers/InstrumentationHandler/TraceParent.html +336 -0
- data/docs/api/Brut/FrontEnd/Handlers/InstrumentationHandler.html +399 -0
- data/docs/api/Brut/FrontEnd/Handlers/LocaleDetectionHandler.html +354 -0
- data/docs/api/Brut/FrontEnd/Handlers/MissingHandler/Form.html +151 -0
- data/docs/api/Brut/FrontEnd/Handlers/MissingHandler.html +315 -0
- data/docs/api/Brut/FrontEnd/Handlers.html +125 -0
- data/docs/api/Brut/FrontEnd/HandlingResults.html +339 -0
- data/docs/api/Brut/FrontEnd/HttpMethod.html +661 -0
- data/docs/api/Brut/FrontEnd/HttpStatus.html +496 -0
- data/docs/api/Brut/FrontEnd/InlineSvgLocator.html +284 -0
- data/docs/api/Brut/FrontEnd/Layout.html +318 -0
- data/docs/api/Brut/FrontEnd/Middleware.html +135 -0
- data/docs/api/Brut/FrontEnd/Middlewares/AnnotateBrutOwnedPaths.html +288 -0
- data/docs/api/Brut/FrontEnd/Middlewares/Favicon.html +292 -0
- data/docs/api/Brut/FrontEnd/Middlewares/OpenTelemetrySpan.html +324 -0
- data/docs/api/Brut/FrontEnd/Middlewares/ReloadApp.html +372 -0
- data/docs/api/Brut/FrontEnd/Middlewares.html +125 -0
- data/docs/api/Brut/FrontEnd/Page.html +773 -0
- data/docs/api/Brut/FrontEnd/Pages/MissingPage.html +797 -0
- data/docs/api/Brut/FrontEnd/Pages.html +125 -0
- data/docs/api/Brut/FrontEnd/RequestContext.html +1312 -0
- data/docs/api/Brut/FrontEnd/RouteHook.html +424 -0
- data/docs/api/Brut/FrontEnd/RouteHooks/AgeFlash.html +242 -0
- data/docs/api/Brut/FrontEnd/RouteHooks/CSPNoInlineScripts.html +249 -0
- data/docs/api/Brut/FrontEnd/RouteHooks/CSPNoInlineStylesOrScripts/ReportOnly.html +264 -0
- data/docs/api/Brut/FrontEnd/RouteHooks/CSPNoInlineStylesOrScripts.html +261 -0
- data/docs/api/Brut/FrontEnd/RouteHooks/LocaleDetection.html +284 -0
- data/docs/api/Brut/FrontEnd/RouteHooks/SetupRequestContext.html +252 -0
- data/docs/api/Brut/FrontEnd/RouteHooks.html +115 -0
- data/docs/api/Brut/FrontEnd/Routing/FormHandlerRoute.html +227 -0
- data/docs/api/Brut/FrontEnd/Routing/FormRoute.html +305 -0
- data/docs/api/Brut/FrontEnd/Routing/MissingForm.html +324 -0
- data/docs/api/Brut/FrontEnd/Routing/MissingHandler.html +319 -0
- data/docs/api/Brut/FrontEnd/Routing/MissingPage.html +315 -0
- data/docs/api/Brut/FrontEnd/Routing/MissingPath.html +315 -0
- data/docs/api/Brut/FrontEnd/Routing/PageRoute.html +327 -0
- data/docs/api/Brut/FrontEnd/Routing/Route.html +761 -0
- data/docs/api/Brut/FrontEnd/Routing.html +927 -0
- data/docs/api/Brut/FrontEnd/Session.html +1195 -0
- data/docs/api/Brut/FrontEnd.html +134 -0
- data/docs/api/Brut/I18n/BaseMethods.html +931 -0
- data/docs/api/Brut/I18n/ForBackEnd.html +302 -0
- data/docs/api/Brut/I18n/ForCLI.html +302 -0
- data/docs/api/Brut/I18n/ForHTML.html +296 -0
- data/docs/api/Brut/I18n/HTTPAcceptLanguage/AlwaysEnglish.html +316 -0
- data/docs/api/Brut/I18n/HTTPAcceptLanguage.html +930 -0
- data/docs/api/Brut/I18n.html +127 -0
- data/docs/api/Brut/Instrumentation/LoggerSpanExporter.html +435 -0
- data/docs/api/Brut/Instrumentation/OpenTelemetry/NormalizedAttributes.html +286 -0
- data/docs/api/Brut/Instrumentation/OpenTelemetry/Span.html +302 -0
- data/docs/api/Brut/Instrumentation/OpenTelemetry.html +864 -0
- data/docs/api/Brut/Instrumentation.html +126 -0
- data/docs/api/Brut/SinatraHelpers/ClassMethods.html +532 -0
- data/docs/api/Brut/SinatraHelpers.html +281 -0
- data/docs/api/Brut/SpecSupport/ClockSupport.html +383 -0
- data/docs/api/Brut/SpecSupport/ComponentSupport.html +502 -0
- data/docs/api/Brut/SpecSupport/E2ETestServer.html +503 -0
- data/docs/api/Brut/SpecSupport/E2eSupport.html +142 -0
- data/docs/api/Brut/SpecSupport/EnhancedNode.html +403 -0
- data/docs/api/Brut/SpecSupport/FlashSupport.html +278 -0
- data/docs/api/Brut/SpecSupport/GeneralSupport/ClassMethods.html +401 -0
- data/docs/api/Brut/SpecSupport/GeneralSupport.html +195 -0
- data/docs/api/Brut/SpecSupport/HandlerSupport.html +160 -0
- data/docs/api/Brut/SpecSupport/Matchers/HaveConstraintViolation.html +553 -0
- data/docs/api/Brut/SpecSupport/Matchers/HaveHTMLAttribute.html +439 -0
- data/docs/api/Brut/SpecSupport/Matchers.html +125 -0
- data/docs/api/Brut/SpecSupport/RSpecSetup/OptionalSidekiqSupport.html +335 -0
- data/docs/api/Brut/SpecSupport/RSpecSetup.html +602 -0
- data/docs/api/Brut/SpecSupport/SessionSupport.html +196 -0
- data/docs/api/Brut/SpecSupport.html +129 -0
- data/docs/api/Brut.html +225 -0
- data/docs/api/Clock.html +603 -0
- data/docs/api/RichString.html +968 -0
- data/docs/api/SemanticLogger/Appender/Async.html +219 -0
- data/docs/api/Sequel/Extensions/BrutInstrumentation.html +115 -0
- data/docs/api/Sequel/Extensions/BrutMigrations.html +533 -0
- data/docs/api/Sequel/Extensions.html +117 -0
- data/docs/api/Sequel/Plugins/CreatedAt/InstanceMethods.html +105 -0
- data/docs/api/Sequel/Plugins/CreatedAt.html +125 -0
- data/docs/api/Sequel/Plugins/ExternalId/ClassMethods.html +207 -0
- data/docs/api/Sequel/Plugins/ExternalId/InstanceMethods.html +186 -0
- data/docs/api/Sequel/Plugins/ExternalId.html +218 -0
- data/docs/api/Sequel/Plugins/FindBang/ClassMethods.html +202 -0
- data/docs/api/Sequel/Plugins/FindBang.html +125 -0
- data/docs/api/Sequel/Plugins.html +117 -0
- data/docs/api/Sequel.html +117 -0
- data/docs/api/_index.html +1553 -0
- data/docs/api/class_list.html +54 -0
- data/docs/api/css/common.css +1 -0
- data/docs/api/css/full_list.css +58 -0
- data/docs/api/css/style.css +503 -0
- data/docs/api/file.README.html +127 -0
- data/docs/api/file_list.html +59 -0
- data/docs/api/frames.html +22 -0
- data/docs/api/index.html +127 -0
- data/docs/api/js/app.js +344 -0
- data/docs/api/js/full_list.js +242 -0
- data/docs/api/js/jquery.js +4 -0
- data/docs/api/method_list.html +3998 -0
- data/docs/api/top-level-namespace.html +112 -0
- data/docs/assets/ai.md.tZrjP9im.js +1 -0
- data/docs/assets/ai.md.tZrjP9im.lean.js +1 -0
- data/docs/assets/app.D_yaTITQ.js +1 -0
- data/docs/assets/assets.md.D3wunzLx.js +19 -0
- data/docs/assets/assets.md.D3wunzLx.lean.js +1 -0
- data/docs/assets/brut-js.md.o2DAO2s2.js +12 -0
- data/docs/assets/brut-js.md.o2DAO2s2.lean.js +1 -0
- data/docs/assets/business-logic.md.BY4hGy0m.js +1 -0
- data/docs/assets/business-logic.md.BY4hGy0m.lean.js +1 -0
- data/docs/assets/chunks/@localSearchIndexroot.BsN5i0Fi.js +1 -0
- data/docs/assets/chunks/VPLocalSearchBox.B2-ZzyTY.js +8 -0
- data/docs/assets/chunks/framework.1L-BeKqY.js +18 -0
- data/docs/assets/chunks/theme.CfGFVRvE.js +2 -0
- data/docs/assets/cli.md.RmeA2b0i.js +127 -0
- data/docs/assets/cli.md.RmeA2b0i.lean.js +1 -0
- data/docs/assets/components.md.eCttGlN-.js +104 -0
- data/docs/assets/components.md.eCttGlN-.lean.js +1 -0
- data/docs/assets/configuration.md.BRriU0cL.js +78 -0
- data/docs/assets/configuration.md.BRriU0cL.lean.js +1 -0
- data/docs/assets/css.md.DJgj2clw.js +21 -0
- data/docs/assets/css.md.DJgj2clw.lean.js +1 -0
- data/docs/assets/custom-element-tests.md.BrYJQEl3.js +69 -0
- data/docs/assets/custom-element-tests.md.BrYJQEl3.lean.js +1 -0
- data/docs/assets/database-access.md.C7l-Vuvb.js +63 -0
- data/docs/assets/database-access.md.C7l-Vuvb.lean.js +1 -0
- data/docs/assets/database-schema.md.BUjR0VS1.js +63 -0
- data/docs/assets/database-schema.md.BUjR0VS1.lean.js +1 -0
- data/docs/assets/deployment.md.Dbka4OTr.js +1 -0
- data/docs/assets/deployment.md.Dbka4OTr.lean.js +1 -0
- data/docs/assets/dev-env-overview.Gj7NWM8-.png +0 -0
- data/docs/assets/dev-env-protocol.DysDAtnz.png +0 -0
- data/docs/assets/dev-environment.md.BNc8AYiK.js +11 -0
- data/docs/assets/dev-environment.md.BNc8AYiK.lean.js +1 -0
- data/docs/assets/doc-conventions.md.DCfRXXi-.js +1 -0
- data/docs/assets/doc-conventions.md.DCfRXXi-.lean.js +1 -0
- data/docs/assets/end-to-end-tests.md.yfQHC0b5.js +26 -0
- data/docs/assets/end-to-end-tests.md.yfQHC0b5.lean.js +1 -0
- data/docs/assets/flash-and-session.md.BXY8RvT0.js +93 -0
- data/docs/assets/flash-and-session.md.BXY8RvT0.lean.js +1 -0
- data/docs/assets/forms.md.CBTYQ_Cz.js +379 -0
- data/docs/assets/forms.md.CBTYQ_Cz.lean.js +1 -0
- data/docs/assets/getting-started.md.Bz2s1Vjb.js +2 -0
- data/docs/assets/getting-started.md.Bz2s1Vjb.lean.js +1 -0
- data/docs/assets/handlers.md.089DVD3v.js +69 -0
- data/docs/assets/handlers.md.089DVD3v.lean.js +1 -0
- data/docs/assets/hooks.md.C4-moMny.js +80 -0
- data/docs/assets/hooks.md.C4-moMny.lean.js +1 -0
- data/docs/assets/i18n.md.Do9i1qWl.js +23 -0
- data/docs/assets/i18n.md.Do9i1qWl.lean.js +1 -0
- data/docs/assets/index.md.B28EwVpq.js +1 -0
- data/docs/assets/index.md.B28EwVpq.lean.js +1 -0
- data/docs/assets/instrumentation.md.CL6ax7nT.js +35 -0
- data/docs/assets/instrumentation.md.CL6ax7nT.lean.js +1 -0
- data/docs/assets/javascript.md.GWbhRS51.js +31 -0
- data/docs/assets/javascript.md.GWbhRS51.lean.js +1 -0
- data/docs/assets/jobs.md.S-2amAYp.js +1 -0
- data/docs/assets/jobs.md.S-2amAYp.lean.js +1 -0
- data/docs/assets/keyword-injection.md.Dt2tKREs.js +25 -0
- data/docs/assets/keyword-injection.md.Dt2tKREs.lean.js +1 -0
- data/docs/assets/markdown-examples.md.CCFEQO44.js +33 -0
- data/docs/assets/markdown-examples.md.CCFEQO44.lean.js +1 -0
- data/docs/assets/middleware.md.Czz_UlJN.js +20 -0
- data/docs/assets/middleware.md.Czz_UlJN.lean.js +1 -0
- data/docs/assets/not-released.md.BBy28McC.js +1 -0
- data/docs/assets/not-released.md.BBy28McC.lean.js +1 -0
- data/docs/assets/overview.Da81cB9R.png +0 -0
- data/docs/assets/overview.md.CDalkuxV.js +133 -0
- data/docs/assets/overview.md.CDalkuxV.lean.js +1 -0
- data/docs/assets/pages.md.BE3kfOc5.js +122 -0
- data/docs/assets/pages.md.BE3kfOc5.lean.js +1 -0
- data/docs/assets/routes.md.BMM7peut.js +29 -0
- data/docs/assets/routes.md.BMM7peut.lean.js +1 -0
- data/docs/assets/security.md.C668yXCi.js +1 -0
- data/docs/assets/security.md.C668yXCi.lean.js +1 -0
- data/docs/assets/seed-data.md.BvFZlqIk.js +14 -0
- data/docs/assets/seed-data.md.BvFZlqIk.lean.js +1 -0
- data/docs/assets/spa.qejUdp-5.png +0 -0
- data/docs/assets/space-time-continuum.md.KPUIKysQ.js +1 -0
- data/docs/assets/space-time-continuum.md.KPUIKysQ.lean.js +1 -0
- data/docs/assets/style.D73IYGCX.css +1 -0
- data/docs/assets/tutorial.md.BnoGjrdK.js +1 -0
- data/docs/assets/tutorial.md.BnoGjrdK.lean.js +1 -0
- data/docs/assets/unit-tests.md.DUGrnLj5.js +13 -0
- data/docs/assets/unit-tests.md.DUGrnLj5.lean.js +1 -0
- data/docs/assets/workspace-protocol.C0gXsoDb.png +0 -0
- data/docs/assets.html +42 -0
- data/docs/brut-css/brut.css +1 -0
- data/docs/brut-css/brut.max.css +22372 -0
- data/docs/brut-css/classes/appearances.html +783 -0
- data/docs/brut-css/classes/background-colors.html +3529 -0
- data/docs/brut-css/classes/border-colors.html +3529 -0
- data/docs/brut-css/classes/borders.html +2293 -0
- data/docs/brut-css/classes/dimensions.html +2581 -0
- data/docs/brut-css/classes/flex.html +917 -0
- data/docs/brut-css/classes/foreground-colors.html +3261 -0
- data/docs/brut-css/classes/junk-drawer.html +431 -0
- data/docs/brut-css/classes/layout.html +668 -0
- data/docs/brut-css/classes/lists.html +331 -0
- data/docs/brut-css/classes/positioning.html +1751 -0
- data/docs/brut-css/classes/spacings.html +2633 -0
- data/docs/brut-css/classes/typography.html +2206 -0
- data/docs/brut-css/customization/advanced-configuration.html +204 -0
- data/docs/brut-css/customization/breakpoints.html +227 -0
- data/docs/brut-css/customization/design-system.html +197 -0
- data/docs/brut-css/customization/pseudo-classes.html +228 -0
- data/docs/brut-css/docs.css +98 -0
- data/docs/brut-css/getting-started/core-concepts.html +234 -0
- data/docs/brut-css/getting-started/installation.html +190 -0
- data/docs/brut-css/getting-started/overview.html +210 -0
- data/docs/brut-css/getting-started/simple-example.html +285 -0
- data/docs/brut-css/index.html +193 -0
- data/docs/brut-css/prism-twilight.min.css +1 -0
- data/docs/brut-css/properties/colors.html +1548 -0
- data/docs/brut-css/properties/spacings.html +614 -0
- data/docs/brut-css/properties/typography.html +777 -0
- data/docs/brut-js/api/AjaxSubmit.html +374 -0
- data/docs/brut-js/api/AjaxSubmit.js.html +435 -0
- data/docs/brut-js/api/Autosubmit.html +192 -0
- data/docs/brut-js/api/Autosubmit.js.html +114 -0
- data/docs/brut-js/api/BaseCustomElement.html +1091 -0
- data/docs/brut-js/api/BaseCustomElement.js.html +312 -0
- data/docs/brut-js/api/BrutCustomElements.html +172 -0
- data/docs/brut-js/api/BufferedLogger.html +173 -0
- data/docs/brut-js/api/ConfirmSubmit.html +278 -0
- data/docs/brut-js/api/ConfirmSubmit.js.html +167 -0
- data/docs/brut-js/api/ConfirmationDialog.html +425 -0
- data/docs/brut-js/api/ConfirmationDialog.js.html +194 -0
- data/docs/brut-js/api/ConstraintViolationMessage.html +448 -0
- data/docs/brut-js/api/ConstraintViolationMessage.js.html +176 -0
- data/docs/brut-js/api/ConstraintViolationMessages.html +590 -0
- data/docs/brut-js/api/ConstraintViolationMessages.js.html +149 -0
- data/docs/brut-js/api/CopyToClipboard.html +345 -0
- data/docs/brut-js/api/CopyToClipboard.js.html +147 -0
- data/docs/brut-js/api/Form.html +294 -0
- data/docs/brut-js/api/Form.js.html +202 -0
- data/docs/brut-js/api/I18nTranslation.html +409 -0
- data/docs/brut-js/api/I18nTranslation.js.html +112 -0
- data/docs/brut-js/api/LocaleDetection.html +312 -0
- data/docs/brut-js/api/LocaleDetection.js.html +168 -0
- data/docs/brut-js/api/Logger.html +702 -0
- data/docs/brut-js/api/Logger.js.html +141 -0
- data/docs/brut-js/api/Message.html +238 -0
- data/docs/brut-js/api/Message.js.html +107 -0
- data/docs/brut-js/api/PrefixedLogger.html +369 -0
- data/docs/brut-js/api/RichString.html +1049 -0
- data/docs/brut-js/api/RichString.js.html +164 -0
- data/docs/brut-js/api/Tabs.html +295 -0
- data/docs/brut-js/api/Tabs.js.html +219 -0
- data/docs/brut-js/api/Tracing.html +277 -0
- data/docs/brut-js/api/Tracing.js.html +298 -0
- data/docs/brut-js/api/external-CustomElementRegistry.html +140 -0
- data/docs/brut-js/api/external-Performance.html +138 -0
- data/docs/brut-js/api/external-Promise.html +138 -0
- data/docs/brut-js/api/external-ValidityState.html +138 -0
- data/docs/brut-js/api/external-Window.html +233 -0
- data/docs/brut-js/api/external-fetch.html +138 -0
- data/docs/brut-js/api/global.html +400 -0
- data/docs/brut-js/api/index.html +168 -0
- data/docs/brut-js/api/index.js.html +181 -0
- data/docs/brut-js/api/module-testing.html +383 -0
- data/docs/brut-js/api/scripts/linenumber.js +25 -0
- data/docs/brut-js/api/scripts/prettify/Apache-License-2.0.txt +202 -0
- data/docs/brut-js/api/scripts/prettify/lang-css.js +2 -0
- data/docs/brut-js/api/scripts/prettify/prettify.js +28 -0
- data/docs/brut-js/api/styles/jsdoc-default.css +327 -0
- data/docs/brut-js/api/styles/prettify-jsdoc.css +111 -0
- data/docs/brut-js/api/styles/prettify-tomorrow.css +132 -0
- data/docs/brut-js/api/testing.AssetMetadata.html +172 -0
- data/docs/brut-js/api/testing.AssetMetadataLoader.html +171 -0
- data/docs/brut-js/api/testing.CustomElementTest.html +679 -0
- data/docs/brut-js/api/testing.DOMCreator.html +171 -0
- data/docs/brut-js/api/testing_AssetMetadata.js.html +86 -0
- data/docs/brut-js/api/testing_AssetMetadataLoader.js.html +76 -0
- data/docs/brut-js/api/testing_CustomElementTest.js.html +286 -0
- data/docs/brut-js/api/testing_DOMCreator.js.html +96 -0
- data/docs/brut-js/api/testing_index.js.html +99 -0
- data/docs/brut-js.html +35 -0
- data/docs/business-logic.html +24 -0
- data/docs/cli.html +150 -0
- data/docs/components.html +127 -0
- data/docs/configuration.html +101 -0
- data/docs/css.html +44 -0
- data/docs/custom-element-tests.html +92 -0
- data/docs/database-access.html +86 -0
- data/docs/database-schema.html +86 -0
- data/docs/deployment.html +24 -0
- data/docs/dev-environment.html +34 -0
- data/docs/doc-conventions.html +24 -0
- data/docs/end-to-end-tests.html +49 -0
- data/docs/flash-and-session.html +116 -0
- data/docs/forms.html +402 -0
- data/docs/getting-started.html +25 -0
- data/docs/handlers.html +92 -0
- data/docs/hashmap.json +1 -0
- data/docs/hooks.html +103 -0
- data/docs/i18n.html +46 -0
- data/docs/images/logo-300.png +0 -0
- data/docs/images/logo.png +0 -0
- data/docs/index.html +24 -0
- data/docs/instrumentation.html +58 -0
- data/docs/javascript.html +54 -0
- data/docs/jobs.html +24 -0
- data/docs/keyword-injection.html +48 -0
- data/docs/markdown-examples.html +56 -0
- data/docs/middleware.html +43 -0
- data/docs/not-released.html +24 -0
- data/docs/overview.html +156 -0
- data/docs/pages.html +145 -0
- data/docs/routes.html +52 -0
- data/docs/security.html +24 -0
- data/docs/seed-data.html +37 -0
- data/docs/space-time-continuum.html +24 -0
- data/docs/tutorial.html +24 -0
- data/docs/unit-tests.html +36 -0
- data/docs/vp-icons.css +1 -0
- data/lib/brut/cli/app_runner.rb +1 -1
- data/lib/brut/cli/apps/test.rb +5 -0
- data/lib/brut/framework/mcp.rb +0 -4
- data/lib/brut/front_end/component.rb +59 -84
- data/lib/brut/front_end/components/constraint_violations.rb +1 -4
- data/lib/brut/front_end/components/form_tag.rb +1 -1
- data/lib/brut/front_end/components/input.rb +3 -3
- data/lib/brut/front_end/components/inputs/csrf_token.rb +1 -1
- data/lib/brut/front_end/components/inputs/{text_field.rb → input_tag.rb} +6 -8
- data/lib/brut/front_end/components/inputs/radio_button.rb +1 -1
- data/lib/brut/front_end/components/inputs/select_tag_with_options.rb +187 -0
- data/lib/brut/front_end/components/inputs/{textarea.rb → textarea_tag.rb} +2 -2
- data/lib/brut/front_end/components/time_tag.rb +2 -1
- data/lib/brut/front_end/form.rb +4 -4
- data/lib/brut/front_end/forms/input.rb +2 -1
- data/lib/brut/front_end/forms/input_definition.rb +5 -2
- data/lib/brut/front_end/forms/radio_button_group_input.rb +2 -1
- data/lib/brut/front_end/forms/radio_button_group_input_definition.rb +2 -2
- data/lib/brut/front_end/forms/select_input.rb +2 -4
- data/lib/brut/front_end/forms/select_input_definition.rb +2 -2
- data/lib/brut/front_end/handler.rb +28 -26
- data/lib/brut/front_end/handlers/csp_reporting_handler.rb +5 -2
- data/lib/brut/front_end/handlers/instrumentation_handler.rb +8 -4
- data/lib/brut/front_end/handlers/locale_detection_handler.rb +9 -5
- data/lib/brut/front_end/handlers/missing_handler.rb +5 -2
- data/lib/brut/front_end/page.rb +4 -6
- data/lib/brut/front_end/request_context.rb +3 -2
- data/lib/brut/i18n/base_methods.rb +136 -82
- data/lib/brut/i18n/for_back_end.rb +1 -0
- data/lib/brut/i18n/for_cli.rb +1 -0
- data/lib/brut/i18n/for_html.rb +32 -4
- data/lib/brut/instrumentation/open_telemetry.rb +12 -2
- data/lib/brut/sinatra_helpers.rb +10 -3
- data/lib/brut/spec_support/component_support.rb +18 -18
- data/lib/brut/spec_support/e2e_test_server.rb +3 -0
- data/lib/brut/version.rb +1 -1
- data/lib/sequel/extensions/brut_migrations.rb +1 -1
- metadata +647 -5
- data/lib/brut/front_end/components/inputs/select.rb +0 -117
@@ -0,0 +1,931 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<meta charset="utf-8">
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
6
|
+
<title>
|
7
|
+
Module: Brut::I18n::BaseMethods
|
8
|
+
|
9
|
+
— Documentation by YARD 0.9.37
|
10
|
+
|
11
|
+
</title>
|
12
|
+
|
13
|
+
<link rel="stylesheet" href="../../css/style.css" type="text/css" />
|
14
|
+
|
15
|
+
<link rel="stylesheet" href="../../css/common.css" type="text/css" />
|
16
|
+
|
17
|
+
<script type="text/javascript">
|
18
|
+
pathId = "Brut::I18n::BaseMethods";
|
19
|
+
relpath = '../../';
|
20
|
+
</script>
|
21
|
+
|
22
|
+
|
23
|
+
<script type="text/javascript" charset="utf-8" src="../../js/jquery.js"></script>
|
24
|
+
|
25
|
+
<script type="text/javascript" charset="utf-8" src="../../js/app.js"></script>
|
26
|
+
|
27
|
+
|
28
|
+
</head>
|
29
|
+
<body>
|
30
|
+
<div class="nav_wrap">
|
31
|
+
<iframe id="nav" src="../../class_list.html?1"></iframe>
|
32
|
+
<div id="resizer"></div>
|
33
|
+
</div>
|
34
|
+
|
35
|
+
<div id="main" tabindex="-1">
|
36
|
+
<div id="header">
|
37
|
+
<div id="menu">
|
38
|
+
|
39
|
+
<a href="../../_index.html">Index (B)</a> »
|
40
|
+
<span class='title'><span class='object_link'><a href="../../Brut.html" title="Brut (module)">Brut</a></span></span> » <span class='title'><span class='object_link'><a href="../I18n.html" title="Brut::I18n (module)">I18n</a></span></span>
|
41
|
+
»
|
42
|
+
<span class="title">BaseMethods</span>
|
43
|
+
|
44
|
+
</div>
|
45
|
+
|
46
|
+
<div id="search">
|
47
|
+
|
48
|
+
<a class="full_list_link" id="class_list_link"
|
49
|
+
href="../../class_list.html">
|
50
|
+
|
51
|
+
<svg width="24" height="24">
|
52
|
+
<rect x="0" y="4" width="24" height="4" rx="1" ry="1"></rect>
|
53
|
+
<rect x="0" y="12" width="24" height="4" rx="1" ry="1"></rect>
|
54
|
+
<rect x="0" y="20" width="24" height="4" rx="1" ry="1"></rect>
|
55
|
+
</svg>
|
56
|
+
</a>
|
57
|
+
|
58
|
+
</div>
|
59
|
+
<div class="clear"></div>
|
60
|
+
</div>
|
61
|
+
|
62
|
+
<div id="content"><h1>Module: Brut::I18n::BaseMethods
|
63
|
+
|
64
|
+
|
65
|
+
|
66
|
+
</h1>
|
67
|
+
<div class="box_info">
|
68
|
+
|
69
|
+
|
70
|
+
|
71
|
+
|
72
|
+
|
73
|
+
|
74
|
+
|
75
|
+
|
76
|
+
|
77
|
+
<dl>
|
78
|
+
<dt>Included in:</dt>
|
79
|
+
<dd><span class='object_link'><a href="ForBackEnd.html" title="Brut::I18n::ForBackEnd (module)">ForBackEnd</a></span>, <span class='object_link'><a href="ForCLI.html" title="Brut::I18n::ForCLI (module)">ForCLI</a></span>, <span class='object_link'><a href="ForHTML.html" title="Brut::I18n::ForHTML (module)">ForHTML</a></span></dd>
|
80
|
+
</dl>
|
81
|
+
|
82
|
+
|
83
|
+
|
84
|
+
<dl>
|
85
|
+
<dt>Defined in:</dt>
|
86
|
+
<dd>lib/brut/i18n/base_methods.rb</dd>
|
87
|
+
</dl>
|
88
|
+
|
89
|
+
</div>
|
90
|
+
|
91
|
+
<h2>Overview</h2><div class="docstring">
|
92
|
+
<div class="discussion">
|
93
|
+
<p>Interface for translations, preferred over Ruby's I18n classes. Note that this is a
|
94
|
+
base module and not intended to be directly used in your classes. Include one of
|
95
|
+
the other modules in this namespace:</p>
|
96
|
+
|
97
|
+
<ul>
|
98
|
+
<li><span class='object_link'><a href="ForHTML.html" title="Brut::I18n::ForHTML (module)">ForHTML</a></span> for components or pages, or anything use Phlex</li>
|
99
|
+
<li><span class='object_link'><a href="ForCLI.html" title="Brut::I18n::ForCLI (module)">ForCLI</a></span> for CLI apps</li>
|
100
|
+
<li><span class='object_link'><a href="ForBackEnd.html" title="Brut::I18n::ForBackEnd (module)">ForBackEnd</a></span> for back-end classes that aren't generating HTML</li>
|
101
|
+
</ul>
|
102
|
+
|
103
|
+
|
104
|
+
<p>This module assumes the existence of a three-method protocol that's used for HTML escaping in an
|
105
|
+
HTML-generating web context:</p>
|
106
|
+
|
107
|
+
<ul>
|
108
|
+
<li><code>capture</code> accepts the block yieled to <span class='object_link'><a href="#t-instance_method" title="Brut::I18n::BaseMethods#t (method)">#t</a></span> and returns whatever it generates. This needs to exist
|
109
|
+
because Phlex's API renders to an internal buffer by default. This module needs to allow Phlex
|
110
|
+
API methods to render to a different buffer.</li>
|
111
|
+
<li><code>safe</code> accepts a string and returns a string that is presumed to be HTML safe.</li>
|
112
|
+
<li><code>html_escape</code> accepts a string and returns a string that is HTML escaped.</li>
|
113
|
+
</ul>
|
114
|
+
|
115
|
+
|
116
|
+
<p>This module does not implement these methods and assumes that either the class using this module will
|
117
|
+
implement them or that a submodule being used does. All submodules provided by Brut provide implementations,
|
118
|
+
so this information is only relevant if you are using this module directly.</p>
|
119
|
+
|
120
|
+
|
121
|
+
</div>
|
122
|
+
</div>
|
123
|
+
<div class="tags">
|
124
|
+
|
125
|
+
|
126
|
+
</div>
|
127
|
+
|
128
|
+
|
129
|
+
|
130
|
+
|
131
|
+
|
132
|
+
|
133
|
+
|
134
|
+
<h2>
|
135
|
+
Instance Method Summary
|
136
|
+
<small><a href="#" class="summary_toggle">collapse</a></small>
|
137
|
+
</h2>
|
138
|
+
|
139
|
+
<ul class="summary">
|
140
|
+
|
141
|
+
<li class="public ">
|
142
|
+
<span class="summary_signature">
|
143
|
+
|
144
|
+
<a href="#l-instance_method" title="#l (instance method)">#<strong>l</strong>(date_like, format: :default) ⇒ Object </a>
|
145
|
+
|
146
|
+
|
147
|
+
|
148
|
+
</span>
|
149
|
+
|
150
|
+
|
151
|
+
|
152
|
+
|
153
|
+
|
154
|
+
|
155
|
+
|
156
|
+
|
157
|
+
|
158
|
+
<span class="summary_desc"><div class='inline'>
|
159
|
+
</div></span>
|
160
|
+
|
161
|
+
</li>
|
162
|
+
|
163
|
+
|
164
|
+
<li class="public ">
|
165
|
+
<span class="summary_signature">
|
166
|
+
|
167
|
+
<a href="#t-instance_method" title="#t (instance method)">#<strong>t</strong>(key, **interpolated_values) { ... } ⇒ Object </a>
|
168
|
+
|
169
|
+
|
170
|
+
|
171
|
+
</span>
|
172
|
+
|
173
|
+
|
174
|
+
|
175
|
+
|
176
|
+
|
177
|
+
|
178
|
+
|
179
|
+
|
180
|
+
|
181
|
+
<span class="summary_desc"><div class='inline'><p>Access a translation and insert interpolated elemens as needed.</p>
|
182
|
+
</div></span>
|
183
|
+
|
184
|
+
</li>
|
185
|
+
|
186
|
+
|
187
|
+
<li class="public ">
|
188
|
+
<span class="summary_signature">
|
189
|
+
|
190
|
+
<a href="#t_direct-instance_method" title="#t_direct (instance method)">#<strong>t_direct</strong>(keys, interpolated_values = {}) ⇒ Object </a>
|
191
|
+
|
192
|
+
|
193
|
+
|
194
|
+
</span>
|
195
|
+
|
196
|
+
|
197
|
+
|
198
|
+
|
199
|
+
|
200
|
+
|
201
|
+
|
202
|
+
|
203
|
+
|
204
|
+
<span class="summary_desc"><div class='inline'><p>Directly access translations without trying to be smart about deriving the key.</p>
|
205
|
+
</div></span>
|
206
|
+
|
207
|
+
</li>
|
208
|
+
|
209
|
+
|
210
|
+
<li class="public ">
|
211
|
+
<span class="summary_signature">
|
212
|
+
|
213
|
+
<a href="#this_field_value-instance_method" title="#this_field_value (instance method)">#<strong>this_field_value</strong> ⇒ Object </a>
|
214
|
+
|
215
|
+
|
216
|
+
|
217
|
+
</span>
|
218
|
+
|
219
|
+
|
220
|
+
|
221
|
+
|
222
|
+
|
223
|
+
|
224
|
+
|
225
|
+
|
226
|
+
|
227
|
+
<span class="summary_desc"><div class='inline'>
|
228
|
+
</div></span>
|
229
|
+
|
230
|
+
</li>
|
231
|
+
|
232
|
+
|
233
|
+
</ul>
|
234
|
+
|
235
|
+
|
236
|
+
|
237
|
+
|
238
|
+
<div id="instance_method_details" class="method_details_list">
|
239
|
+
<h2>Instance Method Details</h2>
|
240
|
+
|
241
|
+
|
242
|
+
<div class="method_details first">
|
243
|
+
<h3 class="signature first" id="l-instance_method">
|
244
|
+
|
245
|
+
#<strong>l</strong>(date_like, format: :default) ⇒ <tt>Object</tt>
|
246
|
+
|
247
|
+
|
248
|
+
|
249
|
+
|
250
|
+
|
251
|
+
</h3><table class="source_code">
|
252
|
+
<tr>
|
253
|
+
<td>
|
254
|
+
<pre class="lines">
|
255
|
+
|
256
|
+
|
257
|
+
223
|
258
|
+
224
|
259
|
+
225</pre>
|
260
|
+
</td>
|
261
|
+
<td>
|
262
|
+
<pre class="code"><span class="info file"># File 'lib/brut/i18n/base_methods.rb', line 223</span>
|
263
|
+
|
264
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_l'>l</span><span class='lparen'>(</span><span class='id identifier rubyid_date_like'>date_like</span><span class='comma'>,</span> <span class='label'>format:</span> <span class='symbol'>:default</span><span class='rparen'>)</span>
|
265
|
+
<span class='op'>::</span><span class='const'>I18n</span><span class='op'>::</span><span class='id identifier rubyid_l'>l</span><span class='lparen'>(</span><span class='id identifier rubyid_date_like'>date_like</span><span class='comma'>,</span><span class='label'>format:</span> <span class='id identifier rubyid_format'>format</span><span class='rparen'>)</span>
|
266
|
+
<span class='kw'>end</span></pre>
|
267
|
+
</td>
|
268
|
+
</tr>
|
269
|
+
</table>
|
270
|
+
</div>
|
271
|
+
|
272
|
+
<div class="method_details ">
|
273
|
+
<h3 class="signature " id="t-instance_method">
|
274
|
+
|
275
|
+
#<strong>t</strong>(key, **interpolated_values) { ... } ⇒ <tt>Object</tt>
|
276
|
+
|
277
|
+
|
278
|
+
|
279
|
+
|
280
|
+
|
281
|
+
</h3><div class="docstring">
|
282
|
+
<div class="discussion">
|
283
|
+
<p>Access a translation and insert interpolated elemens as needed. This will use the provided key to determine
|
284
|
+
the actual full key to the translation, as described below. See <span class='object_link'><a href="ForHTML.html#t-instance_method" title="Brut::I18n::ForHTML#t (method)">ForHTML#t</a></span> for details
|
285
|
+
on how this works in the context of a <span class='object_link'><a href="../FrontEnd/Component.html" title="Brut::FrontEnd::Component (class)">FrontEnd::Component</a></span> or <span class='object_link'><a href="../FrontEnd/Page.html" title="Brut::FrontEnd::Page (class)">FrontEnd::Page</a></span>.</p>
|
286
|
+
|
287
|
+
<p>Any missing interpolation will result in an exception, <em>except</em> for the value <code>field</code>. When
|
288
|
+
a string has <code>%{field}</code> in it, but <code>field:</code> is omitted in this call, the value for
|
289
|
+
<code>"cv.this_field"</code> is used. This value, in English, is "this field", so a call
|
290
|
+
to <code>t("email.required")</code> would generate <code>"This field is required"</code>, while a call
|
291
|
+
to <code>t("email.required", field: "E-mail address")</code> would generate <code>"E-mail address is required"</code>.</p>
|
292
|
+
|
293
|
+
|
294
|
+
</div>
|
295
|
+
</div>
|
296
|
+
<div class="tags">
|
297
|
+
|
298
|
+
<div class="examples">
|
299
|
+
<h4 class="tag_title">Examples:</h4>
|
300
|
+
|
301
|
+
|
302
|
+
<h5 class="example_title"><div class='inline'><p>Simplest usage</p>
|
303
|
+
</div></h5>
|
304
|
+
|
305
|
+
<pre class="example code"><code># in your translations file
|
306
|
+
en: {
|
307
|
+
hello: "Hi!"
|
308
|
+
}
|
309
|
+
# in your code
|
310
|
+
t(:hello) # => Hi!</code></pre>
|
311
|
+
|
312
|
+
|
313
|
+
<h5 class="example_title"><div class='inline'><p>Using an array for the key</p>
|
314
|
+
</div></h5>
|
315
|
+
|
316
|
+
<pre class="example code"><code># in your translations file
|
317
|
+
en: {
|
318
|
+
actions: {
|
319
|
+
edit: "Make an edit"
|
320
|
+
}
|
321
|
+
}
|
322
|
+
# in your code
|
323
|
+
t([:actions, :edit]) # => Make an edit</code></pre>
|
324
|
+
|
325
|
+
|
326
|
+
<h5 class="example_title"><div class='inline'><p>Using page:</p>
|
327
|
+
</div></h5>
|
328
|
+
|
329
|
+
<pre class="example code"><code># in your translations file
|
330
|
+
en: {
|
331
|
+
new_widget: "Make a New Widget",
|
332
|
+
pages: {
|
333
|
+
HomePage: {
|
334
|
+
new_widget: "Create new Widget"
|
335
|
+
},
|
336
|
+
WidgetsPage: {
|
337
|
+
new_widget: "Create New"
|
338
|
+
},
|
339
|
+
},
|
340
|
+
}
|
341
|
+
# in your code for HomePage
|
342
|
+
t(:new_widget) # => Create new Widget
|
343
|
+
# in your code for WidgetsPage
|
344
|
+
t(:new_widget) # => Create New
|
345
|
+
# in your code for SomeOtherPage
|
346
|
+
t(:new_widget) # => Make a New Widget</code></pre>
|
347
|
+
|
348
|
+
|
349
|
+
<h5 class="example_title"><div class='inline'><p>Using in a component</p>
|
350
|
+
</div></h5>
|
351
|
+
|
352
|
+
<pre class="example code"><code># in your translations file
|
353
|
+
en: {
|
354
|
+
status: {
|
355
|
+
ready: "Available",
|
356
|
+
stalled: "Stalled",
|
357
|
+
completed: "Done",
|
358
|
+
},
|
359
|
+
components: {
|
360
|
+
TagComponent: {
|
361
|
+
status: {
|
362
|
+
ready: "Ready",
|
363
|
+
stalled: "Waiting",
|
364
|
+
}
|
365
|
+
},
|
366
|
+
},
|
367
|
+
}
|
368
|
+
# in your code for TagComponent
|
369
|
+
t(page: [ :status, :ready ]) # => Ready
|
370
|
+
t(page: [ :status, :completed ]) # => Done
|
371
|
+
# in your code for StatusComponent
|
372
|
+
t(page: [ :status, :ready ]) # => Available
|
373
|
+
t(page: [ :status, :completed ]) # => Done</code></pre>
|
374
|
+
|
375
|
+
|
376
|
+
<h5 class="example_title"><div class='inline'><p>Using in a page-private component</p>
|
377
|
+
</div></h5>
|
378
|
+
|
379
|
+
<pre class="example code"><code># in your translations file
|
380
|
+
en: {
|
381
|
+
status: {
|
382
|
+
ready: "Available",
|
383
|
+
stalled: "Stalled",
|
384
|
+
completed: "Done",
|
385
|
+
},
|
386
|
+
pages: {
|
387
|
+
WidgetsPage: {
|
388
|
+
new_widget: "Create New",
|
389
|
+
nevermind: "Don't Create One",
|
390
|
+
},
|
391
|
+
}
|
392
|
+
components: {
|
393
|
+
"WidgetsPage::WidgetComponent": {
|
394
|
+
new_widget: "Make New Widget",
|
395
|
+
},
|
396
|
+
},
|
397
|
+
}
|
398
|
+
# in your code for WidgetsPage::WidgetComponent
|
399
|
+
t(page: :new_widget) # => Make New Widget
|
400
|
+
t(page: :nevermind) # => Don't Create One</code></pre>
|
401
|
+
|
402
|
+
|
403
|
+
<h5 class="example_title"><div class='inline'><p>Using a block in a page or component</p>
|
404
|
+
</div></h5>
|
405
|
+
|
406
|
+
<pre class="example code"><code># in your translations file
|
407
|
+
en: {
|
408
|
+
greeting: "Hello there %{name}, you may %{block}",
|
409
|
+
}
|
410
|
+
# Inside a component where
|
411
|
+
# Brut::I18n::ForHTML has been included
|
412
|
+
def view_template
|
413
|
+
h1 do
|
414
|
+
raw(t(:greeting), name: user.name) do
|
415
|
+
a(href: "https://support.example.com") do
|
416
|
+
"contact support"
|
417
|
+
end
|
418
|
+
end
|
419
|
+
end
|
420
|
+
end
|
421
|
+
# This will produce this HTML, assuming user.name is "Pat":
|
422
|
+
<h1>
|
423
|
+
Hell there Pat, you may
|
424
|
+
<a href="https://support.example.com">
|
425
|
+
contact support
|
426
|
+
</a>
|
427
|
+
</h1></code></pre>
|
428
|
+
|
429
|
+
</div>
|
430
|
+
<p class="tag_title">Parameters:</p>
|
431
|
+
<ul class="param">
|
432
|
+
|
433
|
+
<li>
|
434
|
+
|
435
|
+
<span class='name'>key</span>
|
436
|
+
|
437
|
+
|
438
|
+
<span class='type'>(<tt>String</tt>, <tt>Symbol</tt>, <tt>Array<String></tt>, <tt>Array<Symbol></tt>)</span>
|
439
|
+
|
440
|
+
|
441
|
+
|
442
|
+
—
|
443
|
+
<div class='inline'><p>used to create one or more keys to be translated.
|
444
|
+
This value's behavior balances predictabilitiy with what key is used and some flexibilty
|
445
|
+
to allow page– or component–specific translations when needed, and fallbacks when not.</p>
|
446
|
+
|
447
|
+
<p>When an array if given, the values are turned into strings and joined with a "." to
|
448
|
+
form a full key.</p>
|
449
|
+
|
450
|
+
<p>Depending on what class this module is mixed into, additional keys will be tried:</p>
|
451
|
+
|
452
|
+
<ul>
|
453
|
+
<li>If this is a page, <code>pages.«page_name».</code> will be prepended and tried before the key passed in.
|
454
|
+
If the <code>pages.«page_name»</code> version is not found, the exact key passed in is checked.</li>
|
455
|
+
<li>If this is a page private component, <code>pages.«page_name».</code> will be prepended and tried before
|
456
|
+
the key passed in. The value for <code>«page_name»</code> is determined by the outer class that this
|
457
|
+
component is a part of.</li>
|
458
|
+
<li>If this is a component (include if it is a page private component),
|
459
|
+
<code>components.«component_name».</code> will be prepended and tried before the key passed in.
|
460
|
+
If the <code>components.«component_name»</code> version is not found, the exact key passed in is checked.</li>
|
461
|
+
</ul>
|
462
|
+
|
463
|
+
|
464
|
+
<p>The priority of the keys are as follows:</p>
|
465
|
+
|
466
|
+
<ol>
|
467
|
+
<li>Component key is checked (unless this is a page)</li>
|
468
|
+
<li>Page key is checked (unless this is a non-page private component)</li>
|
469
|
+
<li>The literal key passed-in is checked</li>
|
470
|
+
</ol>
|
471
|
+
|
472
|
+
|
473
|
+
<p>If no value is found for any key an exception is raised.</p>
|
474
|
+
</div>
|
475
|
+
|
476
|
+
</li>
|
477
|
+
|
478
|
+
<li>
|
479
|
+
|
480
|
+
<span class='name'>interpolated_values</span>
|
481
|
+
|
482
|
+
|
483
|
+
<span class='type'>(<tt>Hash</tt>)</span>
|
484
|
+
|
485
|
+
|
486
|
+
|
487
|
+
—
|
488
|
+
<div class='inline'><p>values to use for interpolation of the key's translation. Note that if
|
489
|
+
<code>:block</code> is part of this has, you may not pass a block to this method. Note also
|
490
|
+
that <code>:count</code> can be used if the key is expected to be pluralized. This value
|
491
|
+
is required for keys that are designed for pluralization. See examples below.</p>
|
492
|
+
</div>
|
493
|
+
|
494
|
+
</li>
|
495
|
+
|
496
|
+
</ul>
|
497
|
+
|
498
|
+
|
499
|
+
|
500
|
+
|
501
|
+
|
502
|
+
|
503
|
+
<p class="tag_title">Options Hash (<tt>**interpolated_values</tt>):</p>
|
504
|
+
<ul class="option">
|
505
|
+
|
506
|
+
<li>
|
507
|
+
<span class="name">count</span>
|
508
|
+
<span class="type">(<tt>Numeric</tt>)</span>
|
509
|
+
<span class="default">
|
510
|
+
|
511
|
+
</span>
|
512
|
+
|
513
|
+
— <div class='inline'><p>Special interpolation to control pluralization.</p>
|
514
|
+
</div>
|
515
|
+
|
516
|
+
</li>
|
517
|
+
|
518
|
+
<li>
|
519
|
+
<span class="name">block</span>
|
520
|
+
<span class="type">(<tt>String</tt>)</span>
|
521
|
+
<span class="default">
|
522
|
+
|
523
|
+
</span>
|
524
|
+
|
525
|
+
— <div class='inline'><p>Value to use for <code>%{block}</code>. If this is used, a block may not be
|
526
|
+
yielded.</p>
|
527
|
+
</div>
|
528
|
+
|
529
|
+
</li>
|
530
|
+
|
531
|
+
</ul>
|
532
|
+
|
533
|
+
|
534
|
+
<p class="tag_title">Yields:</p>
|
535
|
+
<ul class="yield">
|
536
|
+
|
537
|
+
<li>
|
538
|
+
|
539
|
+
|
540
|
+
<span class='type'></span>
|
541
|
+
|
542
|
+
|
543
|
+
|
544
|
+
|
545
|
+
<div class='inline'><p>If a block is passed, it is used for the value of <code>%{block}</code>. No parameters are yielded to the block.</p>
|
546
|
+
</div>
|
547
|
+
|
548
|
+
</li>
|
549
|
+
|
550
|
+
</ul>
|
551
|
+
<p class="tag_title">Yield Returns:</p>
|
552
|
+
<ul class="yieldreturn">
|
553
|
+
|
554
|
+
<li>
|
555
|
+
|
556
|
+
|
557
|
+
<span class='type'>(<tt>String</tt>)</span>
|
558
|
+
|
559
|
+
|
560
|
+
|
561
|
+
—
|
562
|
+
<div class='inline'><p>The value to use for the <code>%{block}</code> interpolation value. There is some nuance to
|
563
|
+
how this works. The value returned is given to <code>capture</code>, and <em>that</em> value
|
564
|
+
is given to <code>safe</code>. Outside of an HTML-rendering context, these methods
|
565
|
+
simply pass through the contents of the block. In an HTML-rendering
|
566
|
+
context, however, these methods are assumed to be from
|
567
|
+
<a href="https://phlex.fun"><code>Phlex::HTML</code></a>. <code>capture</code> will create a new Phlex
|
568
|
+
context and capture any HTML built inside the block. That HTML is assumed
|
569
|
+
to be safe, thus <code>safe</code> is called to communicate this to Phlex.</p>
|
570
|
+
</div>
|
571
|
+
|
572
|
+
</li>
|
573
|
+
|
574
|
+
</ul>
|
575
|
+
<p class="tag_title">Raises:</p>
|
576
|
+
<ul class="raise">
|
577
|
+
|
578
|
+
<li>
|
579
|
+
|
580
|
+
|
581
|
+
<span class='type'>(<tt>I18n::MissingTranslation</tt>)</span>
|
582
|
+
|
583
|
+
|
584
|
+
|
585
|
+
—
|
586
|
+
<div class='inline'><p>if no translation is found</p>
|
587
|
+
</div>
|
588
|
+
|
589
|
+
</li>
|
590
|
+
|
591
|
+
<li>
|
592
|
+
|
593
|
+
|
594
|
+
<span class='type'>(<tt>I18n::MissingInterpolationArgument</tt>)</span>
|
595
|
+
|
596
|
+
|
597
|
+
|
598
|
+
—
|
599
|
+
<div class='inline'><p>if interpolation arguments are missing, or if the key
|
600
|
+
has pluralizations and no count: was given</p>
|
601
|
+
</div>
|
602
|
+
|
603
|
+
</li>
|
604
|
+
|
605
|
+
</ul>
|
606
|
+
|
607
|
+
</div><table class="source_code">
|
608
|
+
<tr>
|
609
|
+
<td>
|
610
|
+
<pre class="lines">
|
611
|
+
|
612
|
+
|
613
|
+
189
|
614
|
+
190
|
615
|
+
191
|
616
|
+
192
|
617
|
+
193
|
618
|
+
194
|
619
|
+
195
|
620
|
+
196
|
621
|
+
197
|
622
|
+
198
|
623
|
+
199
|
624
|
+
200
|
625
|
+
201
|
626
|
+
202
|
627
|
+
203
|
628
|
+
204
|
629
|
+
205
|
630
|
+
206
|
631
|
+
207
|
632
|
+
208
|
633
|
+
209
|
634
|
+
210
|
635
|
+
211
|
636
|
+
212
|
637
|
+
213
|
638
|
+
214
|
639
|
+
215
|
640
|
+
216
|
641
|
+
217
|
642
|
+
218
|
643
|
+
219
|
644
|
+
220
|
645
|
+
221</pre>
|
646
|
+
</td>
|
647
|
+
<td>
|
648
|
+
<pre class="code"><span class="info file"># File 'lib/brut/i18n/base_methods.rb', line 189</span>
|
649
|
+
|
650
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_t'>t</span><span class='lparen'>(</span><span class='id identifier rubyid_key'>key</span><span class='comma'>,</span><span class='op'>**</span><span class='id identifier rubyid_interpolated_values'>interpolated_values</span><span class='comma'>,</span><span class='op'>&</span><span class='id identifier rubyid_block'>block</span><span class='rparen'>)</span>
|
651
|
+
<span class='id identifier rubyid_keys_to_check'>keys_to_check</span> <span class='op'>=</span> <span class='lbracket'>[</span><span class='rbracket'>]</span>
|
652
|
+
<span class='id identifier rubyid_key'>key</span> <span class='op'>=</span> <span class='const'>Array</span><span class='lparen'>(</span><span class='id identifier rubyid_key'>key</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_join'>join</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>.</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span>
|
653
|
+
<span class='id identifier rubyid_is_page_private_component'>is_page_private_component</span> <span class='op'>=</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_kind_of?'>kind_of?</span><span class='lparen'>(</span><span class='const'><span class='object_link'><a href="../../Brut.html" title="Brut (module)">Brut</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="../FrontEnd.html" title="Brut::FrontEnd (module)">FrontEnd</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="../FrontEnd/Component.html" title="Brut::FrontEnd::Component (class)">Component</a></span></span><span class='rparen'>)</span> <span class='op'>&&</span>
|
654
|
+
<span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_page_private?'>page_private?</span>
|
655
|
+
<span class='id identifier rubyid_is_page'>is_page</span> <span class='op'>=</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_kind_of?'>kind_of?</span><span class='lparen'>(</span><span class='const'><span class='object_link'><a href="../../Brut.html" title="Brut (module)">Brut</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="../FrontEnd.html" title="Brut::FrontEnd (module)">FrontEnd</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="../FrontEnd/Page.html" title="Brut::FrontEnd::Page (class)">Page</a></span></span><span class='rparen'>)</span>
|
656
|
+
<span class='id identifier rubyid_is_component'>is_component</span> <span class='op'>=</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_kind_of?'>kind_of?</span><span class='lparen'>(</span><span class='const'><span class='object_link'><a href="../../Brut.html" title="Brut (module)">Brut</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="../FrontEnd.html" title="Brut::FrontEnd (module)">FrontEnd</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="../FrontEnd/Component.html" title="Brut::FrontEnd::Component (class)">Component</a></span></span><span class='rparen'>)</span> <span class='op'>&&</span> <span class='op'>!</span><span class='id identifier rubyid_is_page'>is_page</span>
|
657
|
+
|
658
|
+
<span class='kw'>if</span> <span class='id identifier rubyid_is_component'>is_component</span>
|
659
|
+
<span class='id identifier rubyid_keys_to_check'>keys_to_check</span> <span class='op'><<</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>components.</span><span class='embexpr_beg'>#{</span><span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_component_name'>component_name</span><span class='embexpr_end'>}</span><span class='tstring_content'>.</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_key'>key</span><span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span>
|
660
|
+
<span class='kw'>end</span>
|
661
|
+
<span class='kw'>if</span> <span class='id identifier rubyid_is_page'>is_page</span>
|
662
|
+
<span class='id identifier rubyid_keys_to_check'>keys_to_check</span> <span class='op'><<</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>pages.</span><span class='embexpr_beg'>#{</span><span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_page_name'>page_name</span><span class='embexpr_end'>}</span><span class='tstring_content'>.</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_key'>key</span><span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span>
|
663
|
+
<span class='kw'>elsif</span> <span class='id identifier rubyid_is_page_private_component'>is_page_private_component</span>
|
664
|
+
<span class='id identifier rubyid_keys_to_check'>keys_to_check</span> <span class='op'><<</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>pages.</span><span class='embexpr_beg'>#{</span><span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_containing_page_name'>containing_page_name</span><span class='embexpr_end'>}</span><span class='tstring_content'>.</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_key'>key</span><span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span>
|
665
|
+
<span class='kw'>end</span>
|
666
|
+
<span class='id identifier rubyid_keys_to_check'>keys_to_check</span> <span class='op'><<</span> <span class='id identifier rubyid_key'>key</span>
|
667
|
+
|
668
|
+
<span class='kw'>if</span> <span class='op'>!</span><span class='id identifier rubyid_block'>block</span><span class='period'>.</span><span class='id identifier rubyid_nil?'>nil?</span>
|
669
|
+
<span class='kw'>if</span> <span class='id identifier rubyid_interpolated_values'>interpolated_values</span><span class='lbracket'>[</span><span class='symbol'>:block</span><span class='rbracket'>]</span>
|
670
|
+
<span class='id identifier rubyid_raise'>raise</span> <span class='const'>ArgumentError</span><span class='comma'>,</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>t was given a block and a block: param. You can't do both </span><span class='tstring_end'>"</span></span>
|
671
|
+
<span class='kw'>end</span>
|
672
|
+
<span class='id identifier rubyid_block_contents'>block_contents</span> <span class='op'>=</span> <span class='id identifier rubyid_safe'>safe</span><span class='lparen'>(</span><span class='id identifier rubyid_capture'>capture</span><span class='lparen'>(</span><span class='op'>&</span><span class='id identifier rubyid_block'>block</span><span class='rparen'>)</span><span class='rparen'>)</span>
|
673
|
+
<span class='id identifier rubyid_interpolated_values'>interpolated_values</span><span class='lbracket'>[</span><span class='symbol'>:block</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='id identifier rubyid_block_contents'>block_contents</span>
|
674
|
+
<span class='kw'>end</span>
|
675
|
+
<span class='id identifier rubyid_t_direct'>t_direct</span><span class='lparen'>(</span><span class='id identifier rubyid_keys_to_check'>keys_to_check</span><span class='comma'>,</span><span class='op'>**</span><span class='id identifier rubyid_interpolated_values'>interpolated_values</span><span class='period'>.</span><span class='id identifier rubyid_merge'>merge</span><span class='lparen'>(</span><span class='label'>key_given:</span> <span class='id identifier rubyid_key'>key</span><span class='rparen'>)</span><span class='rparen'>)</span>
|
676
|
+
<span class='kw'>rescue</span> <span class='const'><span class='object_link'><a href="../I18n.html" title="Brut::I18n (module)">I18n</a></span></span><span class='op'>::</span><span class='const'>MissingInterpolationArgument</span> <span class='op'>=></span> <span class='id identifier rubyid_ex'>ex</span>
|
677
|
+
<span class='kw'>if</span> <span class='id identifier rubyid_ex'>ex</span><span class='period'>.</span><span class='id identifier rubyid_key'>key</span><span class='period'>.</span><span class='id identifier rubyid_to_s'>to_s</span> <span class='op'>==</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>block</span><span class='tstring_end'>"</span></span>
|
678
|
+
<span class='id identifier rubyid_raise'>raise</span> <span class='const'>ArgumentError</span><span class='comma'>,</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>One of the keys </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_key'>key</span><span class='period'>.</span><span class='id identifier rubyid_join'>join</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>, </span><span class='tstring_end'>"</span></span><span class='rparen'>)</span><span class='embexpr_end'>}</span><span class='tstring_content'> contained a %{block} interpolation value: '</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_ex'>ex</span><span class='period'>.</span><span class='id identifier rubyid_string'>string</span><span class='embexpr_end'>}</span><span class='tstring_content'>'. This means you must yield a block to `t`</span><span class='tstring_end'>"</span></span>
|
679
|
+
<span class='kw'>else</span>
|
680
|
+
<span class='id identifier rubyid_raise'>raise</span>
|
681
|
+
<span class='kw'>end</span>
|
682
|
+
<span class='kw'>end</span></pre>
|
683
|
+
</td>
|
684
|
+
</tr>
|
685
|
+
</table>
|
686
|
+
</div>
|
687
|
+
|
688
|
+
<div class="method_details ">
|
689
|
+
<h3 class="signature " id="t_direct-instance_method">
|
690
|
+
|
691
|
+
#<strong>t_direct</strong>(keys, interpolated_values = {}) ⇒ <tt>Object</tt>
|
692
|
+
|
693
|
+
|
694
|
+
|
695
|
+
|
696
|
+
|
697
|
+
</h3><div class="docstring">
|
698
|
+
<div class="discussion">
|
699
|
+
<p>Directly access translations without trying to be smart about deriving the key. This is useful
|
700
|
+
if you have the exact keys you want.</p>
|
701
|
+
|
702
|
+
|
703
|
+
</div>
|
704
|
+
</div>
|
705
|
+
<div class="tags">
|
706
|
+
<p class="tag_title">Parameters:</p>
|
707
|
+
<ul class="param">
|
708
|
+
|
709
|
+
<li>
|
710
|
+
|
711
|
+
<span class='name'>keys</span>
|
712
|
+
|
713
|
+
|
714
|
+
<span class='type'>(<tt>Array<String></tt>, <tt>Array<Symbol></tt>)</span>
|
715
|
+
|
716
|
+
|
717
|
+
|
718
|
+
—
|
719
|
+
<div class='inline'><p>list of keys representing what is to be translated. The
|
720
|
+
first key found will be used. If no key in the list is found
|
721
|
+
will raise a I18n::MissingTranslation.</p>
|
722
|
+
</div>
|
723
|
+
|
724
|
+
</li>
|
725
|
+
|
726
|
+
<li>
|
727
|
+
|
728
|
+
<span class='name'>interpolated_values</span>
|
729
|
+
|
730
|
+
|
731
|
+
<span class='type'>(<tt>Hash</tt>)</span>
|
732
|
+
|
733
|
+
|
734
|
+
<em class="default">(defaults to: <tt>{}</tt>)</em>
|
735
|
+
|
736
|
+
|
737
|
+
—
|
738
|
+
<div class='inline'><p>value to use for interpolation of the key's translation</p>
|
739
|
+
</div>
|
740
|
+
|
741
|
+
</li>
|
742
|
+
|
743
|
+
</ul>
|
744
|
+
|
745
|
+
|
746
|
+
|
747
|
+
|
748
|
+
|
749
|
+
|
750
|
+
<p class="tag_title">Options Hash (<tt>interpolated_values</tt>):</p>
|
751
|
+
<ul class="option">
|
752
|
+
|
753
|
+
<li>
|
754
|
+
<span class="name">count</span>
|
755
|
+
<span class="type">(<tt>Numeric</tt>)</span>
|
756
|
+
<span class="default">
|
757
|
+
|
758
|
+
</span>
|
759
|
+
|
760
|
+
— <div class='inline'><p>Special interpolation to control pluralization.</p>
|
761
|
+
</div>
|
762
|
+
|
763
|
+
</li>
|
764
|
+
|
765
|
+
<li>
|
766
|
+
<span class="name">key_given</span>
|
767
|
+
<span class="type">(<tt>String|Symbol</tt>)</span>
|
768
|
+
<span class="default">
|
769
|
+
|
770
|
+
</span>
|
771
|
+
|
772
|
+
— <div class='inline'><p>If included, this is not used for interpolation, but
|
773
|
+
will be used in error messages to represent the key
|
774
|
+
given to <code>t</code>.</p>
|
775
|
+
</div>
|
776
|
+
|
777
|
+
</li>
|
778
|
+
|
779
|
+
</ul>
|
780
|
+
|
781
|
+
|
782
|
+
<p class="tag_title">Raises:</p>
|
783
|
+
<ul class="raise">
|
784
|
+
|
785
|
+
<li>
|
786
|
+
|
787
|
+
|
788
|
+
<span class='type'>(<tt>I18n::MissingTranslation</tt>)</span>
|
789
|
+
|
790
|
+
|
791
|
+
|
792
|
+
—
|
793
|
+
<div class='inline'><p>if no translation is found</p>
|
794
|
+
</div>
|
795
|
+
|
796
|
+
</li>
|
797
|
+
|
798
|
+
<li>
|
799
|
+
|
800
|
+
|
801
|
+
<span class='type'>(<tt>I18n::MissingInterpolationArgument</tt>)</span>
|
802
|
+
|
803
|
+
|
804
|
+
|
805
|
+
—
|
806
|
+
<div class='inline'><p>if interpolation arguments are missing, or if the key
|
807
|
+
has pluralizations and no count: was given</p>
|
808
|
+
</div>
|
809
|
+
|
810
|
+
</li>
|
811
|
+
|
812
|
+
</ul>
|
813
|
+
|
814
|
+
</div><table class="source_code">
|
815
|
+
<tr>
|
816
|
+
<td>
|
817
|
+
<pre class="lines">
|
818
|
+
|
819
|
+
|
820
|
+
246
|
821
|
+
247
|
822
|
+
248
|
823
|
+
249
|
824
|
+
250
|
825
|
+
251
|
826
|
+
252
|
827
|
+
253
|
828
|
+
254
|
829
|
+
255
|
830
|
+
256
|
831
|
+
257
|
832
|
+
258
|
833
|
+
259
|
834
|
+
260
|
835
|
+
261
|
836
|
+
262
|
837
|
+
263
|
838
|
+
264
|
839
|
+
265
|
840
|
+
266
|
841
|
+
267
|
842
|
+
268
|
843
|
+
269
|
844
|
+
270
|
845
|
+
271
|
846
|
+
272
|
847
|
+
273
|
848
|
+
274
|
849
|
+
275</pre>
|
850
|
+
</td>
|
851
|
+
<td>
|
852
|
+
<pre class="code"><span class="info file"># File 'lib/brut/i18n/base_methods.rb', line 246</span>
|
853
|
+
|
854
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_t_direct'>t_direct</span><span class='lparen'>(</span><span class='id identifier rubyid_keys'>keys</span><span class='comma'>,</span><span class='id identifier rubyid_interpolated_values'>interpolated_values</span><span class='op'>=</span><span class='lbrace'>{</span><span class='rbrace'>}</span><span class='rparen'>)</span>
|
855
|
+
<span class='id identifier rubyid_keys'>keys</span> <span class='op'>=</span> <span class='const'>Array</span><span class='lparen'>(</span><span class='id identifier rubyid_keys'>keys</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_map'>map</span><span class='lparen'>(</span><span class='op'>&</span><span class='symbol'>:to_sym</span><span class='rparen'>)</span>
|
856
|
+
<span class='id identifier rubyid_key_given'>key_given</span> <span class='op'>=</span> <span class='id identifier rubyid_interpolated_values'>interpolated_values</span><span class='period'>.</span><span class='id identifier rubyid_delete'>delete</span><span class='lparen'>(</span><span class='symbol'>:key_given</span><span class='rparen'>)</span>
|
857
|
+
<span class='id identifier rubyid_default_interpolated_values'>default_interpolated_values</span> <span class='op'>=</span> <span class='lbrace'>{</span>
|
858
|
+
<span class='label'>field:</span> <span class='id identifier rubyid_this_field_value'>this_field_value</span><span class='comma'>,</span>
|
859
|
+
<span class='rbrace'>}</span>
|
860
|
+
<span class='id identifier rubyid_escaped_interpolated_values'>escaped_interpolated_values</span> <span class='op'>=</span> <span class='id identifier rubyid_interpolated_values'>interpolated_values</span><span class='period'>.</span><span class='id identifier rubyid_map'>map</span> <span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_key'>key</span><span class='comma'>,</span><span class='id identifier rubyid_value'>value</span><span class='op'>|</span>
|
861
|
+
<span class='kw'>if</span> <span class='id identifier rubyid_value'>value</span><span class='period'>.</span><span class='id identifier rubyid_kind_of?'>kind_of?</span><span class='lparen'>(</span><span class='const'>String</span><span class='rparen'>)</span>
|
862
|
+
<span class='lbracket'>[</span> <span class='id identifier rubyid_key'>key</span><span class='comma'>,</span> <span class='id identifier rubyid_html_escape'>html_escape</span><span class='lparen'>(</span><span class='id identifier rubyid_value'>value</span><span class='rparen'>)</span> <span class='rbracket'>]</span>
|
863
|
+
<span class='kw'>else</span>
|
864
|
+
<span class='lbracket'>[</span> <span class='id identifier rubyid_key'>key</span><span class='comma'>,</span> <span class='id identifier rubyid_value'>value</span> <span class='rbracket'>]</span>
|
865
|
+
<span class='kw'>end</span>
|
866
|
+
<span class='rbrace'>}</span><span class='period'>.</span><span class='id identifier rubyid_to_h'>to_h</span>
|
867
|
+
<span class='id identifier rubyid_result'>result</span> <span class='op'>=</span> <span class='op'>::</span><span class='const'>I18n</span><span class='period'>.</span><span class='id identifier rubyid_t'>t</span><span class='lparen'>(</span><span class='id identifier rubyid_keys'>keys</span><span class='period'>.</span><span class='id identifier rubyid_first'>first</span><span class='comma'>,</span> <span class='label'>default:</span> <span class='id identifier rubyid_keys'>keys</span><span class='lbracket'>[</span><span class='int'>1</span><span class='op'>..</span><span class='op'>-</span><span class='int'>1</span><span class='rbracket'>]</span><span class='comma'>,</span><span class='label'>raise:</span> <span class='kw'>true</span><span class='comma'>,</span> <span class='op'>**</span><span class='id identifier rubyid_default_interpolated_values'>default_interpolated_values</span><span class='period'>.</span><span class='id identifier rubyid_merge'>merge</span><span class='lparen'>(</span><span class='id identifier rubyid_escaped_interpolated_values'>escaped_interpolated_values</span><span class='rparen'>)</span><span class='rparen'>)</span>
|
868
|
+
<span class='kw'>if</span> <span class='id identifier rubyid_result'>result</span><span class='period'>.</span><span class='id identifier rubyid_kind_of?'>kind_of?</span><span class='lparen'>(</span><span class='const'>Hash</span><span class='rparen'>)</span>
|
869
|
+
<span class='id identifier rubyid_incorrect_pluralization'>incorrect_pluralization</span> <span class='op'>=</span> <span class='id identifier rubyid_result'>result</span><span class='period'>.</span><span class='id identifier rubyid_keys'>keys</span><span class='period'>.</span><span class='id identifier rubyid_none?'>none?</span> <span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_key'>key</span><span class='op'>|</span> <span class='id identifier rubyid_key'>key</span> <span class='op'>==</span> <span class='symbol'>:one</span> <span class='rbrace'>}</span>
|
870
|
+
<span class='kw'>if</span> <span class='id identifier rubyid_incorrect_pluralization'>incorrect_pluralization</span>
|
871
|
+
<span class='id identifier rubyid_key_message'>key_message</span> <span class='op'>=</span> <span class='kw'>if</span> <span class='id identifier rubyid_key_given'>key_given</span>
|
872
|
+
<span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Key '</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_key_given'>key_given</span><span class='embexpr_end'>}</span><span class='tstring_content'>'</span><span class='tstring_end'>"</span></span>
|
873
|
+
<span class='kw'>else</span>
|
874
|
+
<span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>One of the keys</span><span class='tstring_end'>"</span></span>
|
875
|
+
<span class='kw'>end</span>
|
876
|
+
<span class='id identifier rubyid_raise'>raise</span> <span class='const'><span class='object_link'><a href="../../Brut.html" title="Brut (module)">Brut</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="../Framework.html" title="Brut::Framework (module)">Framework</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="../Framework/Errors.html" title="Brut::Framework::Errors (module)">Errors</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="../Framework/Errors/Bug.html" title="Brut::Framework::Errors::Bug (class)">Bug</a></span></span><span class='comma'>,</span>
|
877
|
+
<span class='tstring'><span class='tstring_beg'>"</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_key_message'>key_message</span><span class='embexpr_end'>}</span><span class='tstring_content'> resulted in a Hash that doesn't appear to be created for pluralizations. This means that you may have given a key expecting it to map to a translation but it is actually a namespace for other keys. Please adjust your translations file to avoid this situation. Keys checked:\n</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_keys'>keys</span><span class='period'>.</span><span class='id identifier rubyid_join'>join</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>, </span><span class='tstring_end'>"</span></span><span class='rparen'>)</span><span class='embexpr_end'>}</span><span class='tstring_content'>\nSub keys found:\n</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_result'>result</span><span class='period'>.</span><span class='id identifier rubyid_keys'>keys</span><span class='period'>.</span><span class='id identifier rubyid_join'>join</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>, </span><span class='tstring_end'>'</span></span><span class='rparen'>)</span><span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span>
|
878
|
+
<span class='kw'>else</span>
|
879
|
+
<span class='id identifier rubyid_raise'>raise</span> <span class='const'><span class='object_link'><a href="../I18n.html" title="Brut::I18n (module)">I18n</a></span></span><span class='op'>::</span><span class='const'>MissingInterpolationArgument</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='symbol'>:count</span><span class='comma'>,</span><span class='id identifier rubyid_interpolated_values'>interpolated_values</span><span class='comma'>,</span><span class='id identifier rubyid_keys'>keys</span><span class='period'>.</span><span class='id identifier rubyid_join'>join</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>,</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span><span class='rparen'>)</span>
|
880
|
+
<span class='kw'>end</span>
|
881
|
+
<span class='kw'>end</span>
|
882
|
+
<span class='id identifier rubyid_result'>result</span>
|
883
|
+
<span class='kw'>end</span></pre>
|
884
|
+
</td>
|
885
|
+
</tr>
|
886
|
+
</table>
|
887
|
+
</div>
|
888
|
+
|
889
|
+
<div class="method_details ">
|
890
|
+
<h3 class="signature " id="this_field_value-instance_method">
|
891
|
+
|
892
|
+
#<strong>this_field_value</strong> ⇒ <tt>Object</tt>
|
893
|
+
|
894
|
+
|
895
|
+
|
896
|
+
|
897
|
+
|
898
|
+
</h3><table class="source_code">
|
899
|
+
<tr>
|
900
|
+
<td>
|
901
|
+
<pre class="lines">
|
902
|
+
|
903
|
+
|
904
|
+
227
|
905
|
+
228
|
906
|
+
229</pre>
|
907
|
+
</td>
|
908
|
+
<td>
|
909
|
+
<pre class="code"><span class="info file"># File 'lib/brut/i18n/base_methods.rb', line 227</span>
|
910
|
+
|
911
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_this_field_value'>this_field_value</span>
|
912
|
+
<span class='ivar'>@__this_field_value</span> <span class='op'>||=</span> <span class='op'>::</span><span class='const'>I18n</span><span class='period'>.</span><span class='id identifier rubyid_t'>t</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>cv.this_field</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='label'>raise:</span> <span class='kw'>true</span><span class='rparen'>)</span>
|
913
|
+
<span class='kw'>end</span></pre>
|
914
|
+
</td>
|
915
|
+
</tr>
|
916
|
+
</table>
|
917
|
+
</div>
|
918
|
+
|
919
|
+
</div>
|
920
|
+
|
921
|
+
</div>
|
922
|
+
|
923
|
+
<div id="footer">
|
924
|
+
Generated on Wed Jun 25 22:57:19 2025 by
|
925
|
+
<a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
926
|
+
0.9.37 (ruby-3.4.4).
|
927
|
+
</div>
|
928
|
+
|
929
|
+
</div>
|
930
|
+
</body>
|
931
|
+
</html>
|