R Shiny Dashboard Header dropdown buttons lead to scrolling - layout

The buttons in the header of my shiny dashboard should be easy to see and press. However, at the moment the dropdownbuttons pop up within the header and people have to scroll in order to see the buttons.
Below you will find a reproducible code sample.
Here is some further information on my session:
R version 3.6.3 (2020-02-29)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 18363)
shinythemes_1.1.2
shinyWidgets_0.5.3
shinyBS_0.61
if (interactive()) {
library(shiny)
require(dplyr)
require(shinydashboard)
require(shinyWidgets)
library(shinythemes)
# A dashboard header with 3 dropdown menus
header <- dashboardHeader(
title = "Dashboard Demo",
tags$li(class = "dropdown",tags$br(),
dropdownButton(inputId = "mydropdown",label = "",# style="minimal",
# label="Language",
circle = FALSE,
icon = icon("globe"),#,status = "primary",
badgeStatus = "success",
prettyRadioButtons(inputId = "selected_language", label="",
choiceNames = list(
HTML("<font color='black'>Deutsch</font>"),
tags$span(style = "color:black", "English")
),
choiceValues = c( "de", "en"),
# inline=TRUE,
selected = "en"
)
)# useShinyalert(), # Set up shinyalert #
,
block = TRUE) ,
tags$li(class = "dropdown",introjsUI(), tags$br(),actionBttn(inputId = "Help",
# color = "primary",
style =
"minimal",
icon = icon("question", lib="font-awesome"),label ="Help", size="sm"),
block = TRUE),tags$li( class = "dropdown",tags$br(),
introBox(dropdownMenu(
type = "notifications",
icon = icon("envelope", lib = "glyphicon"),
badgeStatus = NULL,
headerText = "App maintainer contact:",
notificationItem("TestMailAdress", icon("envelope", lib = "glyphicon"))
), data.step=5, data.intro = "Any further questions? Contact us!")
))
shinyApp(
ui = dashboardPage(
header,
dashboardSidebar(),
dashboardBody()
),
server = function(input, output) { }
)
}
# }

thanks a lot for your answers. I figured it out myself. The introBox referring to the header button messed things up. So without the helping window it works... still would be nice to have the introBox working, but I guess it is just not supported yet...
if (interactive()) {
library(shiny)
require(dplyr)
require(shinydashboard)
require(shinyWidgets)
library(shinythemes)
# A dashboard header with 3 dropdown menus
header <- dashboardHeader(
title = "Dashboard Demo",
tags$li(class = "dropdown",tags$br(),
dropdownButton(inputId = "mydropdown",label = "",# style="minimal",
# label="Language",
circle = FALSE,
icon = icon("globe"),#,status = "primary",
badgeStatus = "success",
prettyRadioButtons(inputId = "selected_language", label="",
choiceNames = list(
HTML("<font color='black'>Deutsch</font>"),
tags$span(style = "color:black", "English")
),
choiceValues = c( "de", "en"),
# inline=TRUE,
selected = "en"
)
)# useShinyalert(), # Set up shinyalert #
,
block = TRUE) ,
tags$li(class = "dropdown",introjsUI(), tags$br(),actionBttn(inputId = "Help",
# color = "primary",
style =
"minimal",
icon = icon("question", lib="font-awesome"),label ="Help", size="sm"),
block = TRUE),tags$li( class = "dropdown",tags$br(),
dropdownMenu(
type = "notifications",
icon = icon("envelope", lib = "glyphicon"),
badgeStatus = NULL,
headerText = "App maintainer contact:",
notificationItem("TestMailAdress", icon("envelope", lib = "glyphicon"))
)
))
shinyApp(
ui = dashboardPage(
header,
dashboardSidebar(),
dashboardBody()
),
server = function(input, output) { }
)
}
# }

Related

Editorconfig setting to allow object-initializer be aligned beneath the new-keyword

I'm using VisualStudio 2022 together with R# 2022.2.4.
Resharper is configured to apply alignment as shown in drawing below. (aligned with the new keyword)
The problem now is that the .editorconfigsettings used by our company come to complain about this due to the fact that we have the following in the editorconfig-file :
# Enforce formatting guidelines
dotnet_diagnostic.IDE0055.severity = error
(our C#-projects are also configured so that warnings are treated as errors, that's the reason why in the error-list I have 4 errors and not warnings)
Already went through the entire editorconfig file to see which setting is causing the error, but don't see anything wrong with it ?
Does anyone have an idea which settings I should change in editorconfig so that the error does not occur anymore ?
`
# Remove the line below if you want to inherit .editorconfig settings from higher directories
root = true
# C# files
[*.cs]
#### Core EditorConfig Options ####
# Indentation and spacing
indent_size = 4
indent_style = space
tab_width = 4
# New line preferences
end_of_line = unset
insert_final_newline = true
#### .NET Coding Conventions ####
# Organize usings
dotnet_separate_import_directive_groups = false
dotnet_sort_system_directives_first = false
file_header_template = unset
# this. and Me. preferences
dotnet_style_qualification_for_event = false:error
dotnet_style_qualification_for_field = false:error
dotnet_style_qualification_for_method = false:error
dotnet_style_qualification_for_property = false:error
# Language keywords vs BCL types preferences
dotnet_style_predefined_type_for_locals_parameters_members = true:error
dotnet_style_predefined_type_for_member_access = true:error
# Parentheses preferences
dotnet_style_parentheses_in_arithmetic_binary_operators = always_for_clarity:suggestion
dotnet_style_parentheses_in_other_binary_operators = always_for_clarity:suggestion
dotnet_style_parentheses_in_other_operators = never_if_unnecessary:silent
dotnet_style_parentheses_in_relational_binary_operators = always_for_clarity:suggestion
# Modifier preferences
dotnet_style_require_accessibility_modifiers = for_non_interface_members:error
# Expression-level preferences
dotnet_style_coalesce_expression = true:suggestion
dotnet_style_collection_initializer = true:suggestion
dotnet_style_explicit_tuple_names = true:suggestion
dotnet_style_null_propagation = true:suggestion
dotnet_style_object_initializer = true:suggestion
dotnet_style_operator_placement_when_wrapping = beginning_of_line
dotnet_style_prefer_auto_properties = true:silent
dotnet_style_prefer_compound_assignment = true:suggestion
dotnet_style_prefer_conditional_expression_over_assignment = true:suggestion
dotnet_style_prefer_conditional_expression_over_return = true:suggestion
dotnet_style_prefer_inferred_anonymous_type_member_names = true:suggestion
dotnet_style_prefer_inferred_tuple_names = true:suggestion
dotnet_style_prefer_is_null_check_over_reference_equality_method = true:suggestion
dotnet_style_prefer_simplified_boolean_expressions = true:suggestion
dotnet_style_prefer_simplified_interpolation = true:suggestion
# Field preferences
dotnet_style_readonly_field = true:suggestion
# Parameter preferences
dotnet_code_quality_unused_parameters = all:suggestion
# Suppression preferences
dotnet_remove_unnecessary_suppression_exclusions = none
#### C# Coding Conventions ####
# var preferences
csharp_style_var_elsewhere = false:suggestion
csharp_style_var_for_built_in_types = false:suggestion
csharp_style_var_when_type_is_apparent = true:suggestion
# Expression-bodied members
csharp_style_expression_bodied_accessors = true:silent
csharp_style_expression_bodied_constructors = false:silent
csharp_style_expression_bodied_indexers = true:silent
csharp_style_expression_bodied_lambdas = true:silent
csharp_style_expression_bodied_local_functions = false:silent
csharp_style_expression_bodied_methods = false:silent
csharp_style_expression_bodied_operators = false:silent
csharp_style_expression_bodied_properties = true:silent
# Pattern matching preferences
csharp_style_pattern_matching_over_as_with_null_check = true:suggestion
csharp_style_pattern_matching_over_is_with_cast_check = true:suggestion
csharp_style_prefer_not_pattern = true:suggestion
csharp_style_prefer_pattern_matching = true:silent
csharp_style_prefer_switch_expression = true:suggestion
# Null-checking preferences
csharp_style_conditional_delegate_call = true:suggestion
# Modifier preferences
csharp_prefer_static_local_function = true:suggestion
csharp_preferred_modifier_order = public,private,protected,internal,static,extern,new,virtual,abstract,sealed,override,readonly,unsafe,volatile,async:error
# Code-block preferences
csharp_prefer_braces =false:silent
csharp_prefer_simple_using_statement = true:suggestion
# Expression-level preferences
csharp_prefer_simple_default_expression = true:suggestion
csharp_style_deconstructed_variable_declaration = true:suggestion
csharp_style_inlined_variable_declaration = true:suggestion
csharp_style_pattern_local_over_anonymous_function = true:suggestion
csharp_style_prefer_index_operator = true:suggestion
csharp_style_prefer_range_operator = true:suggestion
csharp_style_throw_expression = true:suggestion
csharp_style_unused_value_assignment_preference = discard_variable:suggestion
csharp_style_unused_value_expression_statement_preference = discard_variable:silent
# 'using' directive preferences
csharp_using_directive_placement = outside_namespace:error
#### C# Formatting Rules ####
# New line preferences
csharp_new_line_before_catch = true
csharp_new_line_before_else = true
csharp_new_line_before_finally = true
csharp_new_line_before_members_in_anonymous_types = true
csharp_new_line_before_members_in_object_initializers = true
csharp_new_line_before_open_brace = all
csharp_new_line_between_query_expression_clauses = true
# Indentation preferences
csharp_indent_block_contents = true
csharp_indent_braces = false
csharp_indent_case_contents = true
csharp_indent_case_contents_when_block = true
csharp_indent_labels = no_change
csharp_indent_switch_labels = true
# Space preferences
csharp_space_after_cast = false
csharp_space_after_colon_in_inheritance_clause = true
csharp_space_after_comma = true
csharp_space_after_dot = false
csharp_space_after_keywords_in_control_flow_statements = true
csharp_space_after_semicolon_in_for_statement = true
csharp_space_around_binary_operators = before_and_after
csharp_space_around_declaration_statements = false
csharp_space_before_colon_in_inheritance_clause = true
csharp_space_before_comma = false
csharp_space_before_dot = false
csharp_space_before_open_square_brackets = false
csharp_space_before_semicolon_in_for_statement = false
csharp_space_between_empty_square_brackets = false
csharp_space_between_method_call_empty_parameter_list_parentheses = false
csharp_space_between_method_call_name_and_opening_parenthesis = false
csharp_space_between_method_call_parameter_list_parentheses = false
csharp_space_between_method_declaration_empty_parameter_list_parentheses = false
csharp_space_between_method_declaration_name_and_open_parenthesis = false
csharp_space_between_method_declaration_parameter_list_parentheses = false
csharp_space_between_parentheses = false
csharp_space_between_square_brackets = false
# Wrapping preferences
csharp_preserve_single_line_blocks = true
csharp_preserve_single_line_statements = false
#### Naming styles ####
# Naming rules
dotnet_naming_rule.interface_naming.severity = error
dotnet_naming_rule.interface_naming.symbols = interface
dotnet_naming_rule.interface_naming.style = begins_with_i
dotnet_naming_rule.types_should_be_pascal_case.severity = error
dotnet_naming_rule.types_should_be_pascal_case.symbols = types
dotnet_naming_rule.types_should_be_pascal_case.style = pascal_case
dotnet_naming_rule.non_field_members_should_be_pascal_case.severity = error
dotnet_naming_rule.non_field_members_should_be_pascal_case.symbols = non_field_members
dotnet_naming_rule.non_field_members_should_be_pascal_case.style = pascal_case
dotnet_naming_rule.private_or_internal_field_should_be__camelcase.severity = error
dotnet_naming_rule.private_or_internal_field_should_be__camelcase.symbols = private_or_internal_field
dotnet_naming_rule.private_or_internal_field_should_be__camelcase.style = _camelcase
dotnet_naming_rule.non_public_field_should_be_pascalcase.severity = error
dotnet_naming_rule.non_public_field_should_be_pascalcase.symbols = non_public_field
dotnet_naming_rule.non_public_field_should_be_pascalcase.style = pascal_case
dotnet_naming_rule.const_field_should_be_pascalcase.severity = error
dotnet_naming_rule.const_field_should_be_pascalcase.symbols = const_field
dotnet_naming_rule.const_field_should_be_pascalcase.style = pascal_case
dotnet_naming_rule.static_readonly_field_should_be_pascalcase.severity = error
dotnet_naming_rule.static_readonly_field_should_be_pascalcase.symbols = static_readonly_field
dotnet_naming_rule.static_readonly_field_should_be_pascalcase.style = pascal_case
dotnet_naming_rule.parameters_should_be_camelcase.severity = error
dotnet_naming_rule.parameters_should_be_camelcase.symbols = parameters
dotnet_naming_rule.parameters_should_be_camelcase.style = camel_case
dotnet_naming_rule.locals_should_be_camelcase.severity = error
dotnet_naming_rule.locals_should_be_camelcase.symbols = locals
dotnet_naming_rule.locals_should_be_camelcase.style = camel_case
# Symbol specifications
dotnet_naming_symbols.interface.applicable_kinds = interface
dotnet_naming_symbols.interface.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
dotnet_naming_symbols.interface.required_modifiers =
dotnet_naming_symbols.private_or_internal_field.applicable_kinds = field
dotnet_naming_symbols.private_or_internal_field.applicable_accessibilities = internal, private, private_protected
dotnet_naming_symbols.private_or_internal_field.required_modifiers =
dotnet_naming_symbols.non_public_field.applicable_kinds = field
dotnet_naming_symbols.non_public_field.applicable_accessibilities = protected, protected_internal, public
dotnet_naming_symbols.non_public_field.required_modifiers =
dotnet_naming_symbols.const_field.applicable_kinds = field
dotnet_naming_symbols.const_field.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
dotnet_naming_symbols.const_field.required_modifiers = const
dotnet_naming_symbols.static_readonly_field.applicable_kinds = field
dotnet_naming_symbols.static_readonly_field.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
dotnet_naming_symbols.static_readonly_field.required_modifiers = static, readonly
dotnet_naming_symbols.types.applicable_kinds = class, struct, interface, enum
dotnet_naming_symbols.types.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
dotnet_naming_symbols.types.required_modifiers =
dotnet_naming_symbols.non_field_members.applicable_kinds = property, event, method
dotnet_naming_symbols.non_field_members.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
dotnet_naming_symbols.non_field_members.required_modifiers =
dotnet_naming_symbols.parameters.applicable_kinds = parameter
dotnet_naming_symbols.parameters.applicable_accessibilities = *
dotnet_naming_symbols.parameters.required_modifiers =
dotnet_naming_symbols.locals.applicable_kinds = local
dotnet_naming_symbols.locals.applicable_accessibilities = *
dotnet_naming_symbols.locals.required_modifiers =
# Naming styles
dotnet_naming_style.pascal_case.required_prefix =
dotnet_naming_style.pascal_case.required_suffix =
dotnet_naming_style.pascal_case.word_separator =
dotnet_naming_style.pascal_case.capitalization = pascal_case
dotnet_naming_style.begins_with_i.required_prefix = I
dotnet_naming_style.begins_with_i.required_suffix =
dotnet_naming_style.begins_with_i.word_separator =
dotnet_naming_style.begins_with_i.capitalization = pascal_case
dotnet_naming_style._camelcase.required_prefix = _
dotnet_naming_style._camelcase.required_suffix =
dotnet_naming_style._camelcase.word_separator =
dotnet_naming_style._camelcase.capitalization = camel_case
dotnet_naming_style.camel_case.required_prefix =
dotnet_naming_style.camel_case.required_suffix =
dotnet_naming_style.camel_case.word_separator =
dotnet_naming_style.camel_case.capitalization = camel_case
#### dotnet diagnostics ####
# https://docs.microsoft.com/en-us/dotnet/fundamentals/code-analysis/style-rules/
# Remove 'this' qualification (not yet supported on build)
dotnet_diagnostic.IDE0003.severity = error
# Naming styles
dotnet_diagnostic.IDE1006.severity = error
# IDE0036: Order modifiers
dotnet_diagnostic.IDE0036.severity = error
# IDE0040: Add accessibility modifiers
dotnet_diagnostic.IDE0040.severity = error
# IDE0043: Invalid format string
dotnet_diagnostic.IDE0043.severity = error
# Use language keywords instead of framework type names for type references (not yet supported on build)
dotnet_diagnostic.IDE0049.severity = error
##### code quality ####
# CA1001: Types that own disposable fields should be disposable
dotnet_diagnostic.CA1001.severity = error
# CA1032: Implement standard exception constructors
dotnet_diagnostic.CA1032.severity = error
# CA1065: Do not raise exceptions in unexpected locations
dotnet_diagnostic.CA1065.severity = error
# CA1707: Identifiers should not contain underscores
dotnet_diagnostic.CA1707.severity = error
# CA1727: Use PascalCase for named placeholders
dotnet_diagnostic.CA1727.severity = error
# Enforce formatting guidelines
dotnet_diagnostic.IDE0055.severity = error
# Raise error if Tasks aren't awaited, even if calling method is not marked async
dotnet_diagnostic.LindhartAnalyserMissingAwaitWarning.severity=error
# Do not complain about version number not being Major.Minor.Build.Revision (we use semver, which does not include revision)
dotnet_diagnostic.CS7035.severity = none
# Avoid awaiting return a Task representing work that was not started within your context...
dotnet_diagnostic.VSTHRD003.severity = none
# AsyncLazy
dotnet_diagnostic.VSTHRD011.severity = none
# Use explicit task scheduler.
dotnet_diagnostic.VSTHRD105.severity = none
# Don't force async methods to end with Async
dotnet_diagnostic.VSTHRD200.severity = none
##### exceptions to the rules ####
# C# files in a "Contracts" project
[**.Contracts/*.cs]
# Overrides the rule that interfaces should start with 'I' because message interfaces do not need to.
dotnet_naming_rule.interface_naming.style = pascal_case
# C# files in a "Test" project
[**{Test.cs,Tests.cs}]
# CA1707: Identifiers should not contain underscores
# Test names can contain underscores for readability
dotnet_diagnostic.CA1707.severity = silent
`

How to prompt for user info for a key in a map type variable in Terraform

I have the following variable in terraform:
rds_config_list = [
{
rds_name = "shiftleft"
rds_identifier = "shiftleft-postgres"
rds_password = <USETINPUT>
rds_snapshot_identifier = "shiftleft"
rds_postgres_instance_class = "db.m6g.large"
rds_postgres_engine_version = "13.3"
rds_postgres_family = "postgres13"
rds_postgres_allocated_storage = 100
rds_postgres_max_allocated_storage = 1000
rds_backup_retention_period = 7
rds_postgres_multi_az = false
rds_postgres_deletion_protection = false
},
{
rds_name = "shiftleft2"
rds_identifier = "shiftleft2-postgres"
rds_password = <USETINPUT>
rds_snapshot_identifier = "shiftleft2"
rds_postgres_instance_class = "db.m6g.large"
rds_postgres_engine_version = "13.3"
rds_postgres_family = "postgres13"
rds_postgres_allocated_storage = 100
rds_postgres_max_allocated_storage = 1000
rds_backup_retention_period = 7
rds_postgres_multi_az = false
rds_postgres_deletion_protection = false
}
]
i want to prompt for user input for the passwords for each of them and not have the same password for all databases, this is inside a .tfvars file. is there any way to do it?

CheckBoxGroup is not updating in Python/Bokeh

I am trying to create a dashboard of data for our university, and have run into a problem with how it is presenting. I am using Bokeh and Python to create somewhat interactive graphs. My checkbox group is not updating when I click a box to select the college for the major. I have tried changing several items, but cannot figure out what I am doing wrong.
My code:
# Available college list
available_colleges = list(df['College'].unique())
source_maj = ColumnDataSource(df)
grouped_maj = df.groupby('Major').sum()
source_maj = ColumnDataSource(grouped_maj)
major = source_maj.data['Major'].tolist()
p_maj = figure(x_range=major, width=1100, height=500)
p_maj.xaxis.major_label_orientation = math.pi/4
color_map = factor_cmap(field_name='Major',
palette=Magma11, factors=level)
p_maj.vbar(x='Major', top='AY2018_19', source=source_maj, width=0.2, color=color_map)
p_maj.title.text ='Enrollment by Major'
p_maj.xaxis.axis_label = 'Major'
p_maj.yaxis.axis_label = 'Enrolled Students'
hover = HoverTool()
hover.tooltips = [
("2019-2020", "#AY2019_20"),
("2018-2019", "#AY2018_19"),
("2017-2018", "#AY2017_18")]
hover.mode = 'vline'
callback = CustomJS(args=dict(source=source_maj), code="""
const labels = cb_obj.labels;
const active = cb_obj.active;
const data = source_maj.data;
const sourceLen = data.combined.length;
const combined = Array(sourceLen).fill(undefined);
if (active.length > 0) {
const selectedColumns = labels.filter((val, ind) => active.includes(ind));
for(let i = 0; i < sourceLen; i++) {
let sum = 0;
for(col of selectedColumns){
sum += Major[col][i];
}
combined[i] = sum;
}
}
Major.combined=combined;
source_maj.change.emit();
""")
colleges_selection = CheckboxGroup(labels=available_colleges, active = [0], callback=callback)
controls = WidgetBox(colleges_selection)
p_maj = row(controls, p_maj)
Data is formated in a csv sheet that is being read
What it looks like, but nothing updates
Any help is greatly appreciated.
You'll probably want to watch the output the browser sends to the javascript console; it'll tell you what's going wrong here.
A couple places to start: your arguments to the CustomJS object bring in the python object 'source_maj' and rename it as 'source', but then in your JS code you refer to it as 'source_maj'. Also, your JS code makes reference to 'Major', but this isn't an object that the JS knows about (i.e. it wasn't brought in with the args).

Using ClassificationAttributeValueTranslator on impex

I'm trying to use the ClassificationAttributeValueTranslator on an impex. I have some examples with the class ClassificationAttributeTranslator working but can't make this work.
$productCatalog = myCatalog
$classificationCatalog = myClassification
$catalogVersion = catalogversion(catalog(id[default = $productCatalog]), version[default = 'Staged'])[unique = true, default = $productCatalog:Staged]
$clAttrModifiers = system = '$classificationCatalog', version = '1.0', translator = de.hybris.platform.catalog.jalo.classification.impex.ClassificationAttributeValueTranslator, lang = es
//Q_1001 is the ClassAttributeAssignment ID
$feature1 = #Q_1001 [$clAttrModifiers];
//123012 is the product code and
INSERT_UPDATE Product; code[unique = true]; $feature1; $catalogVersion
; 123012 ; TEST VALUE;
I'm getting this error
INSERT_UPDATE Product;code[unique = true];#Q_1001 [system = 'myClassification', version = '1.0', translator = de.hybris.platform.catalog.jalo.classification.impex.ClassificationAttributeValueTranslator, lang = es];catalogversion(catalog(id[default = myCatalog]), version[default = 'Staged'])[unique = true, default = myCatalog:Staged];# invalid special value translator class 'de.hybris.platform.catalog.jalo.classification.impex.ClassificationAttributeValueTranslator' - cannot create due to java.lang.InstantiationException: de.hybris.platform.catalog.jalo.classification.impex.ClassificationAttributeValueTranslator
,,,,invalid special value translator class 'de.hybris.platform.catalog.jalo.classification.impex.ClassificationAttributeValueTranslator' - cannot create due to java.lang.InstantiationException: de.hybris.platform.catalog.jalo.classification.impex.ClassificationAttributeValueTranslator;123012;TEST VALUE;
You have to use de.hybris.platform.catalog.jalo.classification.impex.ClassificationAttributeTranslator and not de.hybris.platform.catalog.jalo.classification.impex.ClassificationAttributeValueTranslator

CocoaPods add subspecs for locale

I have a podspec for my shared code and I was including all locales but then users of the Podspec get their app localized for all languages when they just want a subset.
I would like to allow specification of just the subset for example just English. But I cannot seem to get this type of behavior to work. Any advice?
Sampe Podfile usage
# Just English languages
pod 'MyStuff', '2.4.0'
pod 'MyStuff/en', '2.4.0'
pod 'MyStuff/en-GB', '2.4.0'
Sample Podspec for MyStuff.podspec
Pod::Spec.new do |s|
s.name = 'MyStuff'
s.version = '2.4.0'
s.summary = "MyStuff for iOS."
s.source = {
:git => 'somewhere',
:tag => s.version.to_s
}
s.public_header_files = ['**/**/MyView.h', ...]
s.source_files = ['MyStuff/*.{h,m}' ]
s.resources = ['MyStuff/Resources/*.{png,xib}',
'MyStuff/config.plist']
s.platform = :ios, '5.0'
s.requires_arc = true
s.frameworks = 'CoreGraphics', 'Foundation', 'QuartzCore', 'SystemConfiguration', 'UIKit'
# All locales
s.subspec "all" do |all|
all.resources = ['MyStuff/localization/**']
all.preserve_paths = ['MyStuff/localization/**']
end
# Just en locale
s.subspec "en" do |en|
en.resources = ['MyStuff/localization/en.lproj']
en.preserve_paths = ['MyStuff/localization/en.lproj']
end
# Just en-GB locale
s.subspec "en-GB" do |enGB|
enGB.resources = ['MyStuff/localization/en-GB.lproj']
enGB.preserve_paths = ['MyStuff/localization/en-GB.lproj']
end
# Just fr locale
s.subspec "fr" do |fr|
fr.resources = ['MyStuff/localization/fr.lproj']
fr.preserve_paths = ['MyStuff/localization/fr.lproj']
end
# I have many other locales left out here for brevity.
end
You're going to want to used nested subspecs with default_subspec
# All is default (pod 'PodName/Locale' or pod 'PodName')
s.subspec "Locale" do |l|
l.default_subspec 'All'
l.subspec "All" do |en|
en.resources = 'MyStuff/localization'
en.preserve_paths = 'MyStuff/localization'
end
l.subspec "en" do |en|
en.resources = 'MyStuff/localization/en.lproj'
en.preserve_paths = 'MyStuff/localization/en.lproj'
end
l.subspec "en-GB" do |en|
en.resources = 'MyStuff/localization/en-GB.lproj'
en.preserve_paths = 'MyStuff/localization/en-GB.lproj'
end
l.subspec "en-US" do |en|
en.resources = 'MyStuff/localization/en-US.lproj'
en.preserve_paths = 'MyStuff/localization/en-US.lproj'
end
end
Then in the app's Podfile:
pod 'PodName/Locale/en-GB'
pod 'PodName/Locale/Klingon'
pod 'PodName/Locale/Yoda'
More:
CocoaPod docs
Example podspec with subspecs
Bonus hack
%w|en en-GB en-US|.map {|localename|
l.subspec localename do |loc|
loc.resources = "PodPath/To/Localization/#{localename}.lproj"
loc.preserve_paths = "PodPath/To/Localization/#{localename}.lproj"
end
}

Resources