Sha256: 2b0c193519199690334eba7c9508dbec0335971e8549fbd47f7a53d3dddbd437

Contents?: true

Size: 804 Bytes

Versions: 3

Compression:

Stored size: 804 Bytes

Contents

# frozen_string_literal: true

module Decidim
  module DecidimAwesome
    # This type represents a localized string in a single language.
    class LocalizedCustomFieldsType < Decidim::Api::Types::BaseObject
      description "Represents a particular translation of a LocalizedCustomFieldsType"

      field :locale, GraphQL::Types::String, "The standard locale of this translation.", null: false
      field :fields, GraphQL::Types::JSON, "The fields of this translation.", null: true
      field :machine_translated, GraphQL::Types::Boolean, "Whether this string is machine translated or not.", null: false

      def machine_translated
        if object.respond_to?(:machine_translated)
          object.machine_translated.present?
        else
          false
        end
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
decidim-decidim_awesome-0.10.3 lib/decidim/decidim_awesome/api/types/localized_custom_fields_type.rb
decidim-decidim_awesome-0.11.2 lib/decidim/decidim_awesome/api/types/localized_custom_fields_type.rb
decidim-decidim_awesome-0.11.1 lib/decidim/decidim_awesome/api/types/localized_custom_fields_type.rb