emjot / paperclip-globalize3 Goto Github PK
View Code? Open in Web Editor NEWLocale-specific attachments with paperclip and globalize 3+
License: MIT License
Locale-specific attachments with paperclip and globalize 3+
License: MIT License
(moving the random ideas from the "Future Plans" section in the README to here:)
translates :attachment_name
:translated
option for has_attached_file
or use something like has_translated_attached_file
insteadtranslates
as soon as the :locale interpolation is usedtranslates
after has_attached_file
)The gem has a dependency on globalize (~> 4.0.0), will it be made to support version 5.0.x?
Hi,
when I assign multiple files with different languages and save afterwards, the locale gets lost during the save:
I18n.with_locale(:de) do
model.file = translation[:file]
end
I18n.with_locale(:it) do
model.file = translation[:file]
end
I18n.with_locale(:fr) do
model.file = translation[:file]
end
model.save!
The model is saved successfully, but the there is only one file on my filesystem
because the Attachment object is always the same one.
It's the Attachment for the default locale.
Is it possible to assign multiple translated files and simply save once?
If not I could create a pull request if you are fine with the behaviour.
Best regards
Greetings there,
Can you give me an idea what would be needed for paperclip 3.x integration? I need translated attachments for a system I work on that uses paperclip 3, and I'd consider doing the integration.
I'm thinking after #15 is merged we should also drop support for old paperclip versions < 5.3.0. Lower versions will have deprecation warnings in ruby 2.4+.
(In that case, some conditional code in attachment.rb
as well as some of the Appraisals/gemfiles could be removed.)
image = MyModel.first; image.attachment.clear(:style)
returns empty Array, but image file exists.
#17
Following: "Migrate the paperclip columns ('xxx_file_name' etc.) of the attachment to the translation table"
Hi, here's my migration:
Frame::Contribution.add_translation_fields!({exp1_photo_file_name: :string})
Frame::Contribution.add_translation_fields!({exp1_photo_content_type: :string})
Frame::Contribution.add_translation_fields!({exp1_photo_file_size: :integer})
Frame::Contribution.add_translation_fields!({exp1_photo_updated_at: :timestamp})
What am I missing?
The paperclip rake tasks are currently not aware of translations.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.