MishkaPay.Messages (Mishka Pay v0.0.1)

Copy Markdown View Source

Every message a person can see, translated in the locale of the calling process: the errors of MishkaPay.Errors and the field errors of Mishka Pay's structs. Each is looked up in the mishka_pay domain of gettext_backend/0 when it is shown, so a form shows it in its own locale.

mix gettext.extract finds every text here; priv/gettext/mishka_pay.pot is their template.

Summary

Types

The name of one message.

Functions

Returns the Gettext backend in use: the :gettext_backend of the :mishka_pay application config, or MishkaPay.Gettext.

Returns message key in the caller's locale, with bindings put in its %{name} places.

Types

key()

@type key() ::
  :bad_signature
  | :money_field
  | :currency_unknown
  | :amount_not_exact
  | :amount_not_number
  | :amount_negative
  | :amount_not_positive
  | :amount_too_large
  | :amount_places
  | :base_url
  | :path_plain
  | :path_root
  | :request_options_none
  | :params_plain
  | :one_body
  | :multipart_parts
  | :filename_plain
  | :file_empty
  | :stripe_file_type
  | :stripe_file_size
  | :file_content
  | :return_url
  | :ui_mode_urls
  | :metadata_strings
  | :items_empty
  | :items_currency
  | :items_recurring
  | :items_one_time
  | :trial_mode
  | :price_needs
  | :customer_one_of
  | :customer_needs
  | :reference_reused
  | :percent_off
  | :coupon_one_of
  | :coupon_months
  | :discount_one_of
  | :discounts_or_codes
  | :customer_creation_mode
  | :expires_past
  | :expires_range
  | :plain_id
  | :link_reference
  | :change_nothing
  | :quantity_range
  | :proration_date
  | :managed_payments_invoice
  | :tax_code_missing
  | :tax_id_invalid
  | :tax_not_set_up
  | :tax_location_invalid
  | :tax_lines_many
  | :tax_lines_unique
  | :tax_address
  | :shipping_needs
  | :shipping_days
  | :managed_payments_shipping
  | :webhook_secrets
  | :account_invalid
  | :connect_not_set_up
  | :connect_v1_customer
  | :customer_v2_email
  | :connect_capability_v1
  | :connect_capability_v2
  | :connect_needs_sandbox
  | :connect_v1_refused
  | :fee_percent
  | :fee_currency
  | :stripe_shipping_five
  | :one_time_only
  | :recurring_only
  | :rejected_param
  | :change_item
  | :pause_behavior
  | :link_items
  | :invoice_mode
  | :setup_takes_no
  | :setup_currency
  | :currency_setup_only
  | :rejected_missing
  | :rejected_exists
  | :keys_answer
  | :stripe_id
  | :paypal_id
  | :no_upcoming_invoice
  | :paypal_not_approved
  | :paypal_custom_id
  | :refund_currency
  | :refund_left
  | :capture_over
  | :capture_invoice
  | :refund_once
  | :refund_nothing_left
  | :refund_reference
  | :stripe_metadata
  | :stripe_three_decimal
  | :stripe_whole
  | :meter_interval
  | :usage_value
  | :usage_window
  | :stripe_usage_time
  | :stripe_usage_digits
  | :tax_calculation_failed
  | :evidence_page_limit
  | :due_sent_only
  | :stripe_event_types
  | :stripe_event_object
  | :usage_stream_live
  | :search_needs
  | :subscription_search_needs
  | :subscription_status
  | :invoice_item_moves
  | :credit_note_one_of
  | :tax_percentage
  | :tax_rate_fixed
  | :tax_rates_line_only
  | :tax_rates_automatic
  | :registration_state
  | :registration_scheme
  | :credit_line_needs
  | :phase_prices
  | :phase_length
  | :schedule_from_subscription
  | :proration_discounts_flexible
  | :billing_mode_when_made
  | :schedule_moves
  | :choices
  | :merchant_of_record_off
  | :portal_feature_off
  | :subscription_of_another
  | :intent_of_invoice
  | :intent_of_checkout
  | :endpoint_url
  | :thin_needs_v2
  | :dropdown_options
  | :declined
  | :declined_reason
  | :missing_keys
  | :missing_keys_reason
  | :refused
  | :rejected
  | :rejected_code
  | :rate_limited
  | :provider_cannot_run
  | :provider_not_installed
  | :unreachable
  | :unsupported

The name of one message.

Functions

gettext_backend()

@spec gettext_backend() :: module()

Returns the Gettext backend in use: the :gettext_backend of the :mishka_pay application config, or MishkaPay.Gettext.

text(key, bindings \\ [])

@spec text(key(), keyword()) :: String.t()

Returns message key in the caller's locale, with bindings put in its %{name} places.

iex> MishkaPay.Messages.text(:amount_places, currency: "JPY")
"The amount field has more decimal places than JPY has"