Git Product home page Git Product logo

activeadmin-globalize's People

Contributors

ahmadsherif avatar delphaber avatar dtengeri avatar fabn avatar humancopy avatar jeansreal avatar jklimke avatar joanamartins avatar jtomaszewski avatar marcusg avatar mzampetti avatar nebirhos avatar raihan2006i avatar sepastian avatar spleenteo avatar stefanoverna avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

activeadmin-globalize's Issues

Rails 4.2 compatability

I want to update my project from Rails 4.1 to Rails 4.2.

The globalize Readme states:

When using bundler put this in your Gemfile:

gem 'globalize', '~> 5.0.0'

To use the version of globalize for ActiveRecord 4.0 or 4.1, specify:

gem 'globalize', '~> 4.0.3'

So I also updated the globalize gem from 4 to 5. However when I do this I get a dependency error:

$ bundle update activeadmin-globalize globalize
Updating git://github.com/fabn/activeadmin-globalize.git
Fetching gem metadata from https://rails-assets.org/...
Fetching gem metadata from https://rubygems.org/.........
Fetching additional metadata from https://rubygems.org/..
Resolving dependencies...
Bundler could not find compatible versions for gem "globalize":
  In Gemfile:
    activeadmin-globalize (~> 1.0.0.pre) ruby depends on
      globalize (~> 4.0) ruby

    globalize (5.0.0)

Is there generally a way to get activeadmin-globalize to work with rails 4.2

Publish to rubygems

Is it possible to release a version to rubygems.org? This will enable other gems to depend on the project. The original 'activeadmin-globalize' isn't maintained anymore perhaps namespace the gem as 'activeadmin-globalize-fabn' ?

No destroy checkbox shown when using only localized attributes

Using the following code I don't get the _destroy checkbox on the has_many (even if allow_destroy: true).

    f.inputs '' do
      f.has_many :adornments, allow_destroy: true do |nested_resource|
        nested_resource.translated_inputs '', switch_locale: true do |l|
          l.input :name
        end
      end
    end

If I put a non-localized attribute the _destroy checkbox appears.

Using:

  • activeadmin (1.0.0.pre 930d34c)
  • activeadmin-globalize (1.0.0.pre fd38348)

Sorting throws exception

When sorting a field that belongs to a translation table, an exception in thrown.
This is not a problem of the gem, but the gem should facilitate this.

For `translated_row` show blank translations as "muted / disabled"

I am using an entity which has a number of translated fields. So it would be very practical for me to see all the missing attribute - translations at a glance (Fake Screenshot):

screen shot 2014-09-24 at 22 18 16

What I think would also be a nice addition would be to somehow highlight the currently selected language.

Inline selectors without flags

I would love to be able to use the locale selector inline, but with text links instead of flag images (it's a sensitive issue). It could keep using flags by default, but offer the option for the locale short name (e.g. en, en-US) or the localized string (e.g. active_admin.globalize.language.en).

I can work on a PR if there isn't already a way to do this and there is interest in merging.

For clarity, I'm asking about something like this (assuming inline: true):

translated_row :body, selector: :flag # This would be default
translated_row :body, selector: :locale
translated_row :body, selector: :locale_name

And maybe:

translated_row :body, selector: { en: 'something else', es: 'anything, really' }

translated_inputs - only last input is rendered

Thank you for the new version in the develop branch. I've tested it now and it seems to work except for one issue:

When generating a form like the following:

f.translated_inputs "General", switch_locale: true do |t|
t.input :description
t.input :name
end

Only the first t.input is rendered. The second is ignored.

Could you please have another look into this. Thank you!

Translated Fields do not show up in Nested Form

Hello,
First thanks for the work you put into this gem.

I am experiencing an issue with a 1:n relationship between a category and items.
Within a category I would like to add / edit items.

Rails 5.0.1
Ruby 2.3.1

active-admin-globalize commit: 49c219d740a5b4c34b2e6bf0a20e9994d95f1127 on branch develop
active-admin 1.0.0.pre4

with the following models:

class Category < ApplicationRecord



  has_many :items, inverse_of: :category

  translates :name, :description
  active_admin_translates :name, :description

  translation_class.validates_presence_of :name

  accepts_nested_attributes_for :items
end

class Item < ApplicationRecord

  belongs_to :category

  translates :name
  active_admin_translates :name
end

and with the following form:

form do |f|
    f.inputs "Translated fields" do
      f.translated_inputs 'ignored title', switch_locale: false do |t|
        t.input :name
        t.input :description
      end
    end
    f.inputs "items" do
      f.has_many :items do |f_item|
        f_item.inputs "Translated fields" do
          f_item.translated_inputs 'ignored title', switch_locale: false do |ft_item|
            ft_item.input :name
          end
        end
      end
    end
    f.actions
  end

Clicking on add does not show the translated inputs.

http://cloud.godynamo.com/0B3Q1f0A3t1d

I am willing to dig into this issue if the mistake is not on my side, but a few pointers would be appreciated, as i am not familiar with this gem, or the activeadmin one.

Thanks again!

Migration error

I have latest code from develop branch.

Here is workflow:

  1. Create model (+migration)
  2. Add translates methods to model
  3. Add translation migration for model
    run rake db:migrate and you will get such errors:

activeadmin-28e8a8f36640/lib/active_admin/error.rb:43:in rescue in capture': Your file, app/models/hotel.rb (line 5), caused a database error while Active Admin was loading. This is most common when your database is missing or doesn't have the latest migrations applied. To prevent this error, move the code to a place where it will only be run when a page is rendered. One solution can be, to wrap the query in a Proc.Original error message: PG::UndefinedTable: ERROR: relation "hotels" does not exist LINE 5: WHERE a.attrelid = '"hotels"'::regclass
on line 5 we have:
translates :description, :room_services_description

If you remove this line from model, run migration this will also fail because next migration needs create_translation_table! method.

I think it's really critical issue.

Filters don't work

The filters for fields that belong to a translation table aren't shown anymore.

Looking for help in maintaining this project

Currently I do not have much spare time and not using AA+globalize anymore in my active projects.

It would be nice to fix current issues now that AA has released a stable version there's room for improvements in this project too.

If someone want to help please and become a maintainer for this project please contact me.

Empty translation created without adding it in the UI

I did run into an issue but there was no issue tracker enabled on the repo:

  • Create a new entity and only add the default translation (German in my case):
    screen shot 2014-09-24 at 22 12 00
  • I save
  • The translation_status now shows German AND English even though I did not provide an English translation: screen shot 2014-09-24 at 21 12 40
  • I edit the entity and save without changes:
    screen shot 2014-09-24 at 21 12 55
  • Now only “German” is shown for translation_status which is correct:
    screen shot 2014-09-24 at 21 13 07

The original plugin did that as well which I think is the reason for a problem that I am running into on production environment:
See globalize/globalize#362

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.