diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a287c9f8d..8677f5400 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -18,6 +18,7 @@ jobs: # - "bullet_train-incoming_webhooks" # - "bullet_train-integrations" # - "bullet_train-integrations-stripe" + # - "bullet_train-internationalization" # - "bullet_train-obfuscates_id" # - "bullet_train-outgoing_webhooks" - "bullet_train-roles" diff --git a/.gitignore b/.gitignore index 55aa77e2f..018a030ad 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ /tmp/ .idea/ +/**/.DS_Store diff --git a/bin/bump-all b/bin/bump-all index aeeffada9..443841007 100755 --- a/bin/bump-all +++ b/bin/bump-all @@ -105,6 +105,7 @@ class CoreBumpCLI < Thor bullet_train-incoming_webhooks bullet_train-integrations bullet_train-integrations-stripe + bullet_train-internationalization bullet_train-obfuscates_id bullet_train-outgoing_webhooks bullet_train-roles diff --git a/bin/checkout-and-link-starter-repo b/bin/checkout-and-link-starter-repo index 4051fbb1a..3441c9118 100755 --- a/bin/checkout-and-link-starter-repo +++ b/bin/checkout-and-link-starter-repo @@ -30,6 +30,7 @@ packages=( "bullet_train-incoming_webhooks" "bullet_train-integrations" "bullet_train-integrations-stripe" + "bullet_train-internationalization" "bullet_train-obfuscates_id" "bullet_train-outgoing_webhooks" "bullet_train-roles" diff --git a/bin/release-all b/bin/release-all index 0fc3630c0..a19fb6f50 100755 --- a/bin/release-all +++ b/bin/release-all @@ -103,6 +103,7 @@ class CoreBumpCLI < Thor bullet_train-incoming_webhooks bullet_train-integrations bullet_train-integrations-stripe + bullet_train-internationalization bullet_train-obfuscates_id bullet_train-outgoing_webhooks bullet_train-roles diff --git a/bullet_train-internationalization/.gitignore b/bullet_train-internationalization/.gitignore new file mode 100644 index 000000000..9106b2a34 --- /dev/null +++ b/bullet_train-internationalization/.gitignore @@ -0,0 +1,8 @@ +/.bundle/ +/.yardoc +/_yardoc/ +/coverage/ +/doc/ +/pkg/ +/spec/reports/ +/tmp/ diff --git a/bullet_train-internationalization/.standard.yml b/bullet_train-internationalization/.standard.yml new file mode 100644 index 000000000..9e88fbbe8 --- /dev/null +++ b/bullet_train-internationalization/.standard.yml @@ -0,0 +1,2 @@ +# For available configuration options, see: +# https://github.com/testdouble/standard diff --git a/bullet_train-internationalization/CHANGELOG.md b/bullet_train-internationalization/CHANGELOG.md new file mode 100644 index 000000000..d402cc2b1 --- /dev/null +++ b/bullet_train-internationalization/CHANGELOG.md @@ -0,0 +1,5 @@ +## [Unreleased] + +## [1.3.11] - 2023-08-22 + +- Initial release diff --git a/bullet_train-internationalization/Gemfile b/bullet_train-internationalization/Gemfile new file mode 100644 index 000000000..6dc3e714c --- /dev/null +++ b/bullet_train-internationalization/Gemfile @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +source "https://rubygems.org" + +# Specify your gem's dependencies in bullet_train-internationalization.gemspec +gemspec + +gem "rake", "~> 13.0" + +gem "minitest", "~> 5.0" + +gem "standard", "~> 1.3" diff --git a/bullet_train-internationalization/LICENSE.txt b/bullet_train-internationalization/LICENSE.txt new file mode 100644 index 000000000..ee3760328 --- /dev/null +++ b/bullet_train-internationalization/LICENSE.txt @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2023 gazayas + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/bullet_train-internationalization/README.md b/bullet_train-internationalization/README.md new file mode 100644 index 000000000..3213fde59 --- /dev/null +++ b/bullet_train-internationalization/README.md @@ -0,0 +1,35 @@ +# BulletTrain::Internationalization + +TODO: Delete this and the text below, and describe your gem + +Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/bullet_train/internationalization`. To experiment with that code, run `bin/console` for an interactive prompt. + +## Installation + +TODO: Replace `UPDATE_WITH_YOUR_GEM_NAME_PRIOR_TO_RELEASE_TO_RUBYGEMS_ORG` with your gem name right after releasing it to RubyGems.org. Please do not do it earlier due to security reasons. Alternatively, replace this section with instructions to install your gem from git if you don't plan to release to RubyGems.org. + +Install the gem and add to the application's Gemfile by executing: + + $ bundle add UPDATE_WITH_YOUR_GEM_NAME_PRIOR_TO_RELEASE_TO_RUBYGEMS_ORG + +If bundler is not being used to manage dependencies, install the gem by executing: + + $ gem install UPDATE_WITH_YOUR_GEM_NAME_PRIOR_TO_RELEASE_TO_RUBYGEMS_ORG + +## Usage + +TODO: Write usage instructions here + +## Development + +After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake test` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment. + +To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and the created tag, and push the `.gem` file to [rubygems.org](https://rubygems.org). + +## Contributing + +Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/bullet_train-internationalization. + +## License + +The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT). diff --git a/bullet_train-internationalization/Rakefile b/bullet_train-internationalization/Rakefile new file mode 100644 index 000000000..5bb6087f5 --- /dev/null +++ b/bullet_train-internationalization/Rakefile @@ -0,0 +1,14 @@ +# frozen_string_literal: true + +require "bundler/gem_tasks" +require "rake/testtask" + +Rake::TestTask.new(:test) do |t| + t.libs << "test" + t.libs << "lib" + t.test_files = FileList["test/**/test_*.rb"] +end + +require "standard/rake" + +task default: %i[test standard] diff --git a/bullet_train-internationalization/bin/console b/bullet_train-internationalization/bin/console new file mode 100755 index 000000000..bec333fec --- /dev/null +++ b/bullet_train-internationalization/bin/console @@ -0,0 +1,15 @@ +#!/usr/bin/env ruby +# frozen_string_literal: true + +require "bundler/setup" +require "bullet_train/internationalization" + +# You can add fixtures and/or initialization code here to make experimenting +# with your gem easier. You can also use a different console, if you like. + +# (If you use this, don't forget to add pry to your Gemfile!) +# require "pry" +# Pry.start + +require "irb" +IRB.start(__FILE__) diff --git a/bullet_train-internationalization/bin/setup b/bullet_train-internationalization/bin/setup new file mode 100755 index 000000000..dce67d860 --- /dev/null +++ b/bullet_train-internationalization/bin/setup @@ -0,0 +1,8 @@ +#!/usr/bin/env bash +set -euo pipefail +IFS=$'\n\t' +set -vx + +bundle install + +# Do any other automated setup that you need to do here diff --git a/bullet_train-internationalization/bullet_train-internationalization.gemspec b/bullet_train-internationalization/bullet_train-internationalization.gemspec new file mode 100644 index 000000000..3a390b306 --- /dev/null +++ b/bullet_train-internationalization/bullet_train-internationalization.gemspec @@ -0,0 +1,35 @@ +# frozen_string_literal: true + +require_relative "lib/bullet_train/internationalization/version" + +Gem::Specification.new do |spec| + spec.name = "bullet_train-internationalization" + spec.version = BulletTrain::Internationalization::VERSION + spec.authors = ["Andrew Culver", "Gabriel Zayas"] + spec.email = ["andrew.culver@gmail.com", "g-zayas@hotmail.com"] + spec.homepage = "https://github.com/bullet-train-co/bullet_train" + spec.summary = "A gem for housing Bullet Train's standard localizations." + spec.description = spec.summary + spec.license = "MIT" + + # spec.metadata["allowed_push_host"] = "TODO: Set to your gem server 'https://example.com'" + + spec.metadata["homepage_uri"] = spec.homepage + spec.metadata["source_code_uri"] = spec.homepage + spec.metadata["changelog_uri"] = spec.homepage + + # Specify which files should be added to the gem when it is released. + # The `git ls-files -z` loads the files in the RubyGem that have been added into git. + spec.files = Dir.chdir(__dir__) do + `git ls-files -z`.split("\x0").reject do |f| + (File.expand_path(f) == __FILE__) || f.start_with?(*%w[bin/ test/ spec/ features/ .git .circleci appveyor]) + end + end + spec.bindir = "exe" + spec.executables = spec.files.grep(%r{\Aexe/}) { |f| File.basename(f) } + spec.require_paths = ["lib"] + + spec.add_development_dependency "rails", ">= 6.0.0" + spec.add_development_dependency "rake", "~> 13.0" + spec.add_development_dependency "standard", "~> 1.5.0" +end diff --git a/bullet_train/config/locales/en/base.yml b/bullet_train-internationalization/config/locales/en/base.yml similarity index 100% rename from bullet_train/config/locales/en/base.yml rename to bullet_train-internationalization/config/locales/en/base.yml diff --git a/bullet_train/config/locales/en/billing/products.en.yml b/bullet_train-internationalization/config/locales/en/billing/products.en.yml similarity index 100% rename from bullet_train/config/locales/en/billing/products.en.yml rename to bullet_train-internationalization/config/locales/en/billing/products.en.yml diff --git a/bullet_train/config/locales/en/devise.en.yml b/bullet_train-internationalization/config/locales/en/devise.en.yml similarity index 100% rename from bullet_train/config/locales/en/devise.en.yml rename to bullet_train-internationalization/config/locales/en/devise.en.yml diff --git a/bullet_train/config/locales/en/doorkeeper.en.yml b/bullet_train-internationalization/config/locales/en/doorkeeper.en.yml similarity index 100% rename from bullet_train/config/locales/en/doorkeeper.en.yml rename to bullet_train-internationalization/config/locales/en/doorkeeper.en.yml diff --git a/bullet_train/config/locales/en/framework_packages.yml b/bullet_train-internationalization/config/locales/en/framework_packages.yml similarity index 100% rename from bullet_train/config/locales/en/framework_packages.yml rename to bullet_train-internationalization/config/locales/en/framework_packages.yml diff --git a/bullet_train/config/locales/en/invitations.en.yml b/bullet_train-internationalization/config/locales/en/invitations.en.yml similarity index 100% rename from bullet_train/config/locales/en/invitations.en.yml rename to bullet_train-internationalization/config/locales/en/invitations.en.yml diff --git a/bullet_train/config/locales/en/memberships.en.yml b/bullet_train-internationalization/config/locales/en/memberships.en.yml similarity index 100% rename from bullet_train/config/locales/en/memberships.en.yml rename to bullet_train-internationalization/config/locales/en/memberships.en.yml diff --git a/bullet_train/config/locales/en/oauth.en.yml b/bullet_train-internationalization/config/locales/en/oauth.en.yml similarity index 100% rename from bullet_train/config/locales/en/oauth.en.yml rename to bullet_train-internationalization/config/locales/en/oauth.en.yml diff --git a/bullet_train/config/locales/en/onboarding/user_details.en.yml b/bullet_train-internationalization/config/locales/en/onboarding/user_details.en.yml similarity index 100% rename from bullet_train/config/locales/en/onboarding/user_details.en.yml rename to bullet_train-internationalization/config/locales/en/onboarding/user_details.en.yml diff --git a/bullet_train/config/locales/en/onboarding/user_email.en.yml b/bullet_train-internationalization/config/locales/en/onboarding/user_email.en.yml similarity index 100% rename from bullet_train/config/locales/en/onboarding/user_email.en.yml rename to bullet_train-internationalization/config/locales/en/onboarding/user_email.en.yml diff --git a/bullet_train/config/locales/en/roles.en.yml b/bullet_train-internationalization/config/locales/en/roles.en.yml similarity index 100% rename from bullet_train/config/locales/en/roles.en.yml rename to bullet_train-internationalization/config/locales/en/roles.en.yml diff --git a/bullet_train/config/locales/en/teams.en.yml b/bullet_train-internationalization/config/locales/en/teams.en.yml similarity index 100% rename from bullet_train/config/locales/en/teams.en.yml rename to bullet_train-internationalization/config/locales/en/teams.en.yml diff --git a/bullet_train/config/locales/en/users.en.yml b/bullet_train-internationalization/config/locales/en/users.en.yml similarity index 100% rename from bullet_train/config/locales/en/users.en.yml rename to bullet_train-internationalization/config/locales/en/users.en.yml diff --git a/bullet_train-internationalization/lib/bullet_train/internationalization.rb b/bullet_train-internationalization/lib/bullet_train/internationalization.rb new file mode 100644 index 000000000..b8275fd1b --- /dev/null +++ b/bullet_train-internationalization/lib/bullet_train/internationalization.rb @@ -0,0 +1,16 @@ +# frozen_string_literal: true + +require_relative "internationalization/version" + +module BulletTrain + module Internationalization + class << self + def locales + root = File.dirname(__FILE__).gsub("lib/bullet_train", "") + Dir.glob("#{root}/config/locales/**/*.yml") + end + end + + class Error < StandardError; end + end +end diff --git a/bullet_train-internationalization/lib/bullet_train/internationalization/engine.rb b/bullet_train-internationalization/lib/bullet_train/internationalization/engine.rb new file mode 100644 index 000000000..2e2c0ddf8 --- /dev/null +++ b/bullet_train-internationalization/lib/bullet_train/internationalization/engine.rb @@ -0,0 +1,6 @@ +module BulletTrain + module Internationalization + class Engine < ::Rails::Engine + end + end +end diff --git a/bullet_train-internationalization/lib/bullet_train/internationalization/version.rb b/bullet_train-internationalization/lib/bullet_train/internationalization/version.rb new file mode 100644 index 000000000..d497d813b --- /dev/null +++ b/bullet_train-internationalization/lib/bullet_train/internationalization/version.rb @@ -0,0 +1,7 @@ +# frozen_string_literal: true + +module BulletTrain + module Internationalization + VERSION = "1.3.10" + end +end diff --git a/bullet_train-internationalization/test/bullet_train/test_internationalization.rb b/bullet_train-internationalization/test/bullet_train/test_internationalization.rb new file mode 100644 index 000000000..74ac94152 --- /dev/null +++ b/bullet_train-internationalization/test/bullet_train/test_internationalization.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +require "test_helper" + +class BulletTrain::TestInternationalization < Minitest::Test + def test_that_it_has_a_version_number + refute_nil ::BulletTrain::Internationalization::VERSION + end + + def test_it_does_something_useful + assert false + end +end diff --git a/bullet_train-internationalization/test/test_helper.rb b/bullet_train-internationalization/test/test_helper.rb new file mode 100644 index 000000000..201d528ae --- /dev/null +++ b/bullet_train-internationalization/test/test_helper.rb @@ -0,0 +1,6 @@ +# frozen_string_literal: true + +$LOAD_PATH.unshift File.expand_path("../lib", __dir__) +require "bullet_train/internationalization" + +require "minitest/autorun" diff --git a/bullet_train/config/locales/en/stimulus.yml b/bullet_train/config/locales/en/stimulus.yml deleted file mode 100644 index bed3143af..000000000 --- a/bullet_train/config/locales/en/stimulus.yml +++ /dev/null @@ -1,38 +0,0 @@ -en: - daterangepicker: - firstDay: 1 - separator: " - " - applyLabel: "Apply" - cancelLabel: "Cancel" - fromLabel: "From" - toLabel: "To" - customRangeLabel: "Custom" - weekLabel: "W" - daysOfWeek: - - "Su" - - "Mo" - - "Tu" - - "We" - - "Th" - - "Fr" - - "Sa" - monthNames: - - "January" - - "February" - - "March" - - "April" - - "May" - - "June" - - "July" - - "August" - - "September" - - "October" - - "November" - - "December" - date_range_controller: - today: Today - yesterday: yesterday - last7Days: Last 7 Days - last30Days: Last 30 Days - thisMonth: This Month - lastMonth: Last Month \ No newline at end of file diff --git a/bullet_train/config/locales/localization.en.yml b/bullet_train/config/locales/localization.en.yml deleted file mode 100644 index 6c6b3bdc6..000000000 --- a/bullet_train/config/locales/localization.en.yml +++ /dev/null @@ -1,13 +0,0 @@ -en: - date: - formats: - date_field: "%m/%d/%Y" - date_and_time_field: "%m/%d/%Y %l:%M %p" - date_controller: "MM/DD/YYYY" - time: - am: AM - pm: PM - formats: - date_field: "%m/%d/%Y" - date_and_time_field: "%m/%d/%Y %l:%M %p" - date_controller: "MM/DD/YYYY h:mm A" \ No newline at end of file